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(405,1089,1277,2938,2943,3206,3352,3464,3758,3856,3860,5082,5145,513,1229,1810,1824,2669,2732,3001,3060,3429,4358,4379,4649), 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 (405,1089,1229,1277,1810,2732,2938,2943,3060,3352,3464,3758,4379,4649,5082,5145,513,1824,2669,3001,3206,3429,3856,3860,4358) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]