1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'or038387_bsdnaen.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(659,847,933,1026,1501,1589,811,812,813,919,922,923,921,920,984,675,950,1006,895,995,1943,1029,658,734,733,817,816,814,927,924,985,987,1024,1025,738,857,693,694,993,1010,792,791,845,800,788,904,776,760,831,900,901,914,815,926,821,819,820,931,930,989,1917,881,787,907,818,928,1502,1590), 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 (658,659,675,693,694,733,734,738,760,776,787,788,791,792,800,811,812,813,814,815,816,817,818,819,820,821,831,845,847,857,881,895,900,901,904,907,914,919,920,921,922,923,924,926,927,928,930,931,933,950,984,985,987,989,993,995,1006,1010,1024,1025,1026,1029,1501,1502,1589,1590,1917,1943) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]