Currency:
1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'al039008_dfrbabr.pov.products_options_values_sort_order' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
in:
[SELECT count(DISTINCT p2a.products_id) as quantity, po.products_options_name, pov.products_options_values_name, SUM(IF(p2a.products_id IN(3654,3606,853,876,944,477,3610,716,995,334,994,3667,4235,1157,1158,1524,4284,4043,4440,4294,1753,1876,2757,4516,1333,3811,3709,2052,4069,4028,1480,4135,4305,1788,3774,2927,2537,1960,4363,1700,1606,1761,1883,4130,4078,2864,1256,1380,3741,3491,1604,2093,1749,3952,1688,4114,3803,4076,4041,1972,4967,4824,4684,4670,4556,4969,4857,2389,1434,570,4426,4050,1537,4094,2695,2064,3711,3645,4825,2808,3668,4549,4914,1857,3034,2544,2926,4929,4820,4884,3408,3512,3383,432,4201,4166,188,3152,2353,2338,2344,2359,2938,4591,4586,3689,5026,1259,4085,4434,1631,3966,4504,3406,3858,2368,2656,592,3158,3658,1783,1691,2145,1214,3365,4768), 1, 0)) as flag FROM products_attributes p2a JOIN products_options po ON p2a.options_id = po.products_options_id JOIN products_options_values pov ON p2a.options_values_id = pov.products_options_values_id WHERE po.products_options_id>2 and p2a.products_id IN (188,334,432,477,570,592,716,853,876,944,994,995,1157,1158,1214,1256,1259,1333,1380,1434,1480,1524,1537,1604,1606,1631,1688,1691,1700,1749,1753,1761,1783,1788,1857,1876,1883,1960,1972,2052,2064,2093,2145,2338,2344,2353,2359,2368,2389,2537,2544,2656,2695,2757,2808,2864,2926,2927,2938,3034,3152,3158,3365,3383,3406,3408,3491,3512,3606,3610,3645,3654,3658,3667,3668,3689,3709,3711,3741,3774,3803,3811,3858,3952,3966,4028,4041,4043,4050,4069,4076,4078,4085,4094,4114,4130,4135,4166,4201,4235,4284,4294,4305,4363,4426,4434,4440,4504,4516,4549,4556,4586,4591,4670,4684,4768,4820,4824,4825,4857,4884,4914,4929,4967,4969,5026) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]