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(187,1895,2125,2540,3132,3445,4163,4600,5267,5423,363,1049,3397,2780,5209,5401,479,1609,2130,2729,2747,5669,623,4929,739,1998,2651,2695,4655,5638,550,914,4414), 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 (479,739,1609,2130,2651,2695,2729,2780,4163,4655,5209,5401,187,363,550,623,914,1049,1895,1998,2125,2540,2747,3132,3397,3445,4414,4600,4929,5267,5423,5638,5669) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]