1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'wa038747_sfsgbv.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(10,11,1,69,70,82,102,104,116,122,191,200,217,251,253,278,296,348,359,383,402,413,415,507,533,532,535,547,562,564,579,605,609,612,654,684,680,686,720,731,734,737,738,739,744,747,751,762,773,780,786,791,827,843,865,883,882,885,890,895,976,997,1010,1025,1027,1039,1045,1049,1115,1139,1154,1156,1183,1205,1221,1286,1334,1363,1395,1402,1412,1426,1428,1434,1437,1445,1435,1443,1460,1526,1529,1556,1582,1597,1601,1602,1604,1614,1613,1639,1647,1655,1673,1681,1699,1701,1704,1717,1741,1739,1750,1769,1787,1815,1816,1835,1867,1884,3030,2361,2628,2890,2202,3155,2572,2397,2748,2015,2551,2903,2901,2114,2564,2216,2265,2709,2637,3182,2273,2072,2992,2423,2147,2365,2298,2578,2690,2259,3133,3080,2818,2133,2769,2412,2899,2020,1958,2765,2945,2137,2507,2078,1923,2384,3150,2101,2753,2042,2618,3132,2937,2463,2893,2939,2284,2047,1913,2185,2256,2487,2498,2482,2215,2874,2999,2249,2336,2731,2694,3122,2522,2751,2489,2666,2652,2035,3020,3064,2547,2338,2527,2907,2918,2095,2016,2447), 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 (1,10,11,69,70,82,102,104,116,122,191,200,217,251,253,278,296,348,359,383,402,413,415,507,532,533,535,547,562,564,579,605,609,612,654,680,684,686,720,731,734,737,738,739,744,747,751,762,773,780,786,791,827,843,865,882,883,885,890,895,976,997,1010,1025,1027,1039,1045,1049,1115,1139,1154,1156,1183,1205,1221,1286,1334,1363,1395,1402,1412,1426,1428,1434,1435,1437,1443,1445,1460,1526,1529,1556,1582,1597,1601,1602,1604,1613,1614,1639,1647,1655,1673,1681,1699,1701,1704,1717,1739,1741,1750,1769,1787,1815,1816,1835,1867,1884,1913,1923,1958,2015,2016,2020,2035,2042,2047,2072,2078,2095,2101,2114,2133,2137,2147,2185,2202,2215,2216,2249,2256,2259,2265,2273,2284,2298,2336,2338,2361,2365,2384,2397,2412,2423,2447,2463,2482,2487,2489,2498,2507,2522,2527,2547,2551,2564,2572,2578,2618,2628,2637,2652,2666,2690,2694,2709,2731,2748,2751,2753,2765,2769,2818,2874,2890,2893,2899,2901,2903,2907,2918,2937,2939,2945,2992,2999,3020,3030,3064,3080,3122,3132,3133,3150,3155,3182) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]