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(139,3182,2937,6227,6262,6303,205,5632,554,2624,1488,2680,2823,142,6216,10,1127,4069,4921,2185,3040,5216,5258,545,1972,3387,5150,1196,2757,4936,5104,1855,3298,553,1918,303,3335,3754,4970,781,2255,2149,3423,1669,5695,3257,5039,1350,1511,5092,5853,526,593,2237,4301,2965,3496,5175,2322,2612,928,1811,1406,2095,3502,4819,2072,4089,111,1622,680,2778,654,2835,641,4276,422,2261,801,1756,625,1989,2785,2956,4187,4307,6870,55,1862,6784,6206,601,1304,5674,3369,5717,5063,5271,370,4244,2141,2525,529,5631,1033,2369,3349,4459,190,2108,4739,5899,4012,5469,2515,2374,3227,5424,3779,429,2284,3197,3974,663,5932,3840,586,4624,3916,4954,4820,2165,2249,2989,4195,5549,3016,3980,1889,2117,5119,171,4829,1788,5214,6699,3626,6147,6789,469,4592,3206,3001,3405,1477,4352,6088,2775,4620,3632,5305,5484,4924,6879,1600,2645,257,1413,2593,1282,4051,5675,63,4843,6316,6480,2856,3523,3993,3503,3998,3274,2031,1933,1680,2755,5265,2376,1131,4103,5909,32,3448,6013,6072,6397,6926,6254,6920,1588,36,3514,6655,5384,6118,1192,5183,1443,6236,6857,5591,4294,5558,5498,3569,2889,6062,3484,1628,3869,1315,1147,3402,2327,5393,6251,1891,2148,2826,3504,4016,241,2159,3801,3946,4262,2173,97,3338,3211,3288,1753,996,5571,5593,523,2170,3198,4073,4681,5439,5918,5555,3161,1842,4746,4018,2859,392,6039,6277,5508,2039,5367), 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 (139,241,523,1282,1315,2170,2249,2624,2775,2937,3161,3484,3523,3632,4195,4746,5305,5439,5498,2165,2889,3779,3840,3916,3980,3998,4820,4954,5932,1891,2859,3211,3288,4018,1788,2593,2826,3197,3402,3504,3946,5265,5918,3182,3626,3869,4620,4924,5484,257,1477,3405,625,641,654,801,1196,2261,2369,2785,4307,4459,5469,10,303,526,529,545,1406,1511,1622,1811,1855,1862,1918,2072,2149,2185,2237,2255,2322,2525,2778,3387,3496,3502,4069,4244,4739,4970,5039,5063,5104,5258,5674,5695,5717,5853,5899,469,3001,3206,4352,4592,36,1600,2645,2856,3514,5384,5675,63,142,171,429,554,1131,1588,1842,2148,2284,2376,2515,3974,4016,4681,4829,5119,5909,996,1147,1413,3016,3274,5571,5593,32,1192,1443,3448,4294,5183,5558,4051,97,392,3338,422,1033,1756,1989,2757,2835,2956,3349,4012,4187,4276,4103,205,5632,1488,55,111,190,370,553,593,601,680,781,928,1127,1304,1350,1669,1972,2095,2108,2141,2612,2965,3040,3257,3298,3335,3369,3423,3754,4089,4301,4819,4921,4936,5092,5150,5175,5216,5271,5631,1680,2031,1889,2117,3227,3993,4843,5424,5591,2039,2173,2680,2989,3801,2327,3198,4624,5549,5555,2159,2755,4073,4262,2374,3569,5393,1628,663,1933,5508,2823,1753,5367,586,5214,3503,6072,6147,6227,6254,6262,6303,6655,6789,6857,6879,6926,6316,6013,6088,6216,6236,6397,6920,6277,6251,6784,6480,6039,6206,6870,6118,6062,6699) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]