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(4278,4395,3039,3010,5208,2313,3178,5350,2347,2530,5080,207,1868,1916,1085,2325,4219,849,5971,2724,2136,5453,1022,208,5692,2914,2311,1265,4212,2758,347,2153,3154,5397,4542,3425,2437,1274,3862,3301,3215,5829,1174,3385,3491,234,5921,6624,113,4139,5607,4689,6587,6596,5510,4317,6338,632,2352,2698,5392,1873,1693,2079,6339,1206,117,2924,2974,440,2267,355,2388,2922,1445,5207,5117,3608,4940,5715,5763,408,477,594,690,3415,368,176,944,1366,1673,2431,3516,3965,4500,5255,5261,5514,5662,1590,1946,3103,5797,727,194,475,1297,1680,1856,2342,2358,2589,3773,4458,4639,5653,5807,2000,2323,2874,2907,1761,328,1539,1655,3009,5052,3633,411,3870,1027,3255,4061,1353,3148,3731,5996,3616,6799,4045,4767), 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 (849,1085,1265,1274,1868,2136,2153,2313,2347,2437,2530,2724,2922,3154,3385,3425,4219,4542,5207,5350,5453,5971,3616,4045,411,3633,328,3009,3148,4317,5117,1027,1206,3039,3255,1693,2079,2698,5392,1873,2924,3731,440,2974,113,632,1539,1655,1761,3608,4139,4940,5052,4689,176,194,368,727,1297,1445,1590,1673,1856,1946,2323,2431,2589,2874,3103,3516,4458,4639,5261,5514,5715,5797,4212,3010,207,208,234,347,1022,1174,1916,2311,2325,2352,2758,2914,3178,3215,3301,3491,3862,5080,5397,5692,5829,5607,408,475,477,594,690,944,1366,1680,2000,2342,2358,2907,3415,3773,3870,3965,4500,5255,5653,5662,5763,5807,4278,5921,4395,4061,117,355,4767,2267,5510,2388,1353,5208,6338,6339,6624,6799,6596,5996,6587) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]