currency:
1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'ch040572_40572chw.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(1197,28,44,1553,1499,1234,1099,316,466,1175,373,565,819,687,1189,243,209,251,1390,873,421,1521,322,1072,1263,959,585,1147,1218,1487,1244,1397,1518,677,1372,996,606,1561,1410,1304,1404,1322,1246,751,595,12,1134,1164,1375,1482,641,543,816,1153,461,1513,534,767,820,329,248,966,277,261,290,1204,235,285,964,259,212,281,287,264,206,166,169,173,167,164,172,681,23,196,252,215,269,109,115,1132,349,660,591,861,529,868,223,458,862,1084), 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 p2a.products_id IN (12,23,28,44,109,115,164,166,167,169,172,173,196,206,209,212,215,223,235,243,248,251,252,259,261,264,269,277,281,285,287,290,316,322,329,349,373,421,458,461,466,529,534,543,565,585,591,595,606,641,660,677,681,687,751,767,816,819,820,861,862,868,873,959,964,966,996,1072,1084,1099,1132,1134,1147,1153,1164,1175,1189,1197,1204,1218,1234,1244,1246,1263,1304,1322,1372,1375,1390,1397,1404,1410,1482,1487,1499,1513,1518,1521,1553,1561) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]