1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'wa038747_sfsgbv.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(123,122,583,582,581,584,820,884,880,883,882,881,953,1009,1010,1132,1189,1777,1776,1775,1823,1824,1825,1835), 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 (122,123,581,582,583,584,820,880,881,882,883,884,953,1009,1010,1132,1189,1775,1776,1777,1823,1824,1825,1835) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]