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(1520,4910,2499,1252,6307,5235,2324,5825,1822,5714,2164,5472,2212,1528,1921,4913,4697,5652,5197,6841,2426,1945,2635,3111,4899,3376,5928,6636,4921,1301,4970,5176,464,1511,593,1987,2463,2233,6491,581,6146,5717,2065,2141,529,1033,5187,5751,5135,4012,2228,3889,2630,6459,6851,6165,6098,6341,5040,947,4905,5120,6760,6925,3332,5106,6084,4267,4797,5520,2540,4600,363,2747,5495,689,5139,1674,4732,1421,5703,2830,5907,3534,3266,4470,157,1660,1775,1573,5193,5192,2147,6366,4424,2022,2419,6520,2600,3702,362,3650,3960,4775,3913,3805,6881,2218,129,599,3062,3326,5772,4193,6575,1785,5828,6608,2473,5798,6712,3101,2168,3953,6622,6911,358,231,5657,541,2372,4129,5211,5027,3639,3695,5662,949,4891,3225,2865,4333,4510,527,2976,4401,5782,2555,1681,6749,913,1014,6548,24,5031,5327,3479,2308,3689,3229,5036,3203,1378,1416,2480,2546,2567,3024,4772,454,6022,442,6738,6644,6908,5796,88,3277,6368,5458,4253,4260,5524,3427,3829,3792,6200), 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 (1775,1921,1945,2022,2372,2480,2499,3326,3534,4697,4910,5120,5652,5714,5825,1378,3111,3332,4260,2168,2419,2546,2567,4129,4772,4891,5027,5036,5211,88,157,362,1252,1822,2555,3062,3266,3650,3913,3953,3960,4424,4470,4899,5192,5197,5772,5828,5928,1674,2218,4797,5495,5520,2233,5135,5187,529,1301,1511,1987,2065,4970,5717,363,599,689,2540,2747,2830,4267,4600,5139,5703,1014,1573,1785,2324,3805,4333,5235,442,913,2147,2228,2600,2635,2865,3229,3277,3702,3889,5524,5796,5907,2473,3427,3639,3792,3829,4253,4775,24,1681,2308,3479,3689,5031,5327,1033,2630,4012,5751,231,358,541,949,3695,5657,3376,1520,1528,1660,2164,2426,3101,4913,5472,464,581,593,2141,2463,4921,527,2976,3225,5662,5782,454,4510,4905,5176,3024,1416,5040,4401,5193,5458,4193,3203,5106,129,947,4732,5798,1421,2212,6368,6022,6098,6307,6341,6491,6520,6881,6911,6575,6608,6636,6165,6200,6366,6459,6548,6622,6712,6749,6851,6760,6925,6644,6908,6146,6084,6738,6841) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]