Currency:
1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'al039008_dfrbabr.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(1880,463,2088,846,514,914,1334,1352,1692,4256,1182,2003,1286,3757,4474,4318,2063,1834,362,1572,1412,1277,1622,2783,1294,1578,1375,1562,3971,4121,2041,1521,1786,1787,1709,2674,3026,1349,3495,1443,1877,1547,1865,2675,2627,2785,1662,4360,4059,4244,3357,4385,936,1177,1512,2838,4675,1935,3704,2847,2853,2668,3013,2749,2724,2523,2839,1711,1858,4595,4539,4523,4564,108,80,65,1722,1140,1821,1564,385,551,3380,3336,2976,3011,2909,2915,2144,94,97,63,2918,2906,2590,2633,4851,2611,2715,2629,2711,4536,2580,2986,4643,4852,4944,4859,3381,5024,3547,2548,2635,2731,2874,411,456,895,443,715,812,3069,3047,1260,4358,4418,4280,1470,1473,2800,4829,2601,3045,2565,1575,2558,3037,4551,4596,2514,2773,4635,2867,2654,2007,2437,3068,3303,3516,3485,1852,1135,851,631,844,1137,1452,4470,4469,1733,1246,3360,59,5049,4738,2742,2540,4669,3194,2137,3482,1906,1533,2101,4493,2134,4485,823,959,3268,3375,1570,2700,2790,3280,3378,2720,2799,2797,3030,2881), 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 (59,63,65,80,94,97,108,362,385,411,443,456,463,514,551,631,715,812,823,844,846,851,895,914,936,959,1135,1137,1140,1177,1182,1246,1260,1277,1286,1294,1334,1349,1352,1375,1412,1443,1452,1470,1473,1512,1521,1533,1547,1562,1564,1570,1572,1575,1578,1622,1662,1692,1709,1711,1722,1733,1786,1787,1821,1834,1852,1858,1865,1877,1880,1906,1935,2003,2007,2041,2063,2088,2101,2134,2137,2144,2437,2514,2523,2540,2548,2558,2565,2580,2590,2601,2611,2627,2629,2633,2635,2654,2668,2674,2675,2700,2711,2715,2720,2724,2731,2742,2749,2773,2783,2785,2790,2797,2799,2800,2838,2839,2847,2853,2867,2874,2881,2906,2909,2915,2918,2976,2986,3011,3013,3026,3030,3037,3045,3047,3068,3069,3194,3268,3280,3303,3336,3357,3360,3375,3378,3380,3381,3482,3485,3495,3516,3547,3704,3757,3971,4059,4121,4244,4256,4280,4318,4358,4360,4385,4418,4469,4470,4474,4485,4493,4523,4536,4539,4551,4564,4595,4596,4635,4643,4669,4675,4738,4829,4851,4852,4859,4944,5024,5049) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]