1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'co038478_hsrts.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(564,1693,3545,5375,2216,3109,599,868,1082,1100,1281,1352,2248,2888,2941,3000,3044,4205,4405,4484,5107,5312,5680,427,467,1737,4957,5085,5276), 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 (564,868,1082,1352,1693,2216,2248,2888,3000,3545,4405,4484,5107,5375,5680,427,467,599,1100,1281,1737,2941,3044,3109,4205,4957,5085,5276,5312) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]