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(32,41,47,81,100,147,152,153,225,230,241,242,276,299,311,346,354,391,397,410,426,444,455,456,457,484,493,544,545,562,573,590,625,635,649,665,703,775,799,875,879,890,920,926,941,956,982,999,1000,1002,1008,1040,1043,1118,1152,1189,1234,1248,1249,1271,1281,1284,1384,1414,1416,1415,1419,1423,1469,1491,1499,1543,1551,1576,1591,1620,1621,1680,1706,1734,1736,1752,1771,1784,1785,1786,1850,1855,3057,2367,2606,3181,2615,2123,1973,2984,2764,2177,2162,2494,2973,2872,2828,2725,2111,2550,2410,2264,2912,2480,2924,2477,2990,3147,2018,2402,2802,2845,1982,2974,2921,2719,2485,2648,2500,2333,2439,2126,3077,2582,2330,1994,3023,3011,1974,1922,2514,2437,2263,2448,2867,3036,2119,2303,2148,2904,2776,2354,3055,2395,2315,2596,2506,2029,2702,3171,2117,2943,2858,2594,2327,2008,2158,2179,2529,2863,2982,3129,2108,2170,2548,2910,2339,2952,2256,2038,2208,2920,3167,2311,2288,2570,2036,2261,2121,2171,3131,2962,1907,2067,2610,2453,2041,2740,2850,3087,1945,2058,2269,2393,2138,2063,2159,2245,2798,2163), 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 (32,41,47,81,100,147,152,153,225,230,241,242,276,299,311,346,354,391,397,410,426,444,455,456,457,484,493,544,545,562,573,590,625,635,649,665,703,775,799,875,879,890,920,926,941,956,982,999,1000,1002,1008,1040,1043,1118,1152,1189,1234,1248,1249,1271,1281,1284,1384,1414,1415,1416,1419,1423,1469,1491,1499,1543,1551,1576,1591,1620,1621,1680,1706,1734,1736,1752,1771,1784,1785,1786,1850,1855,1907,1922,1945,1973,1974,1982,1994,2008,2018,2029,2036,2038,2041,2058,2063,2067,2108,2111,2117,2119,2121,2123,2126,2138,2148,2158,2159,2162,2163,2170,2171,2177,2179,2208,2245,2256,2261,2263,2264,2269,2288,2303,2311,2315,2327,2330,2333,2339,2354,2367,2393,2395,2402,2410,2437,2439,2448,2453,2477,2480,2485,2494,2500,2506,2514,2529,2548,2550,2570,2582,2594,2596,2606,2610,2615,2648,2702,2719,2725,2740,2764,2776,2798,2802,2828,2845,2850,2858,2863,2867,2872,2904,2910,2912,2920,2921,2924,2943,2952,2962,2973,2974,2982,2984,2990,3011,3023,3036,3055,3057,3077,3087,3129,3131,3147,3167,3171,3181) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]