1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'mi039208_eraevva.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(5168,5167,3463,3470,794,4826,4033,791,793,795,784,783,2812,1008,284,4038,3474,3335,3352,3338,4398,4039,1593,1128,1119,1076,2635,1031,988,1034,1101,274,5014,5022,5029,4984,1067,1082,1108,5036,2833,3065,3058,3056,4040,2565,3456,2832,3059,2837,3235,3239,1157,4835,1073,3388,2834,3337,4137), 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 (783,784,791,793,794,795,988,1008,1031,1034,1067,1073,1076,1082,1101,1108,1119,1128,1157,274,284,1593,2565,2635,2812,2832,2833,2834,2837,3056,3058,3059,3065,3235,3239,3335,3337,3338,3352,3388,3456,3463,3470,3474,4033,4038,4039,4040,4137,4398,4826,4835,4984,5014,5022,5029,5036,5167,5168) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]