Currency:
1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'al039008_dfrbabr.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(3776,3834,1247,2778,3903,5046,4520,4569,1520,4698,3600,2345,2791,2908,2663,4991,3016,3904,4957,5031,3367,698,3527,3696,2631,1803,2916,2970,4964,3343,4887,4984,3942,1849,1839,1365,3533,3545,54,4935,308,3444,4627,3038), 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 (54,308,698,1247,1365,1520,1803,1839,1849,2345,2631,2663,2778,2791,2908,2916,2970,3016,3038,3343,3367,3444,3527,3533,3545,3600,3696,3776,3834,3903,3904,3942,4520,4569,4627,4698,4887,4935,4957,4964,4984,4991,5031,5046) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]