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(3002,2812,4604,2707,2950,2783,3012,2757,4708,4633,4516,4593,2792,2857,2551,2770,2697,2515,4701,4605,2762,2969,3006,2894,2566,2513,4628,2905,2830,2795,2621,2914,2524,2750,2624,2947,2786,4616,2777,2755,2622,2640,2660,2870,2600,2729,2758,2718,2927,4611,4576,4693,4599,4545,2911,2984,2813,2670,2608,2674,3026,2716,2960,2982,2751,2884,2778,2880,2537,2560,2710,2967,2542,2576,2569,2675,2999,2864,2564,3020,2844,2627,2785,3007,2681,2966,2990,4634,4696,4570,4614,4683,4677,4541,4692,4671,4574,2630,2628,4589,4582,4612,2734,2805,4535,4572,2876,2899,2685,2705,2962,2626,2725,2587,2835,2570,2763,2838,2836,2735,2643,2965,4642,4675,4518,4533,4600,2741,4672,2949,2511,2722,4515,4651,2693,2614,2903,2732,2946,2892,2668,2853,2847,3013,2557,2978,2904,2829,2858,4587,4581,4584,4684,2555,2823,2821,2811,2745,2536,2575,2737,2850,3024,2561,2806,2724,2749,2521,2843,2552,2617,2849,2948,2860,2888,2944,2641,2659,2549,4590,4579,4520,4569,4618,4674,4546,4557,4666,4538,4670,4652,2992,4700,4665,4556,2772,3031,2586,2939,2653,2862,2820,2709,3032,2637,2523,2839,2953,2879,2754,2563,4624,4568,2522,2679,2533,2972,4544,4607,2851,4626,4595,4636,4539,4559,4523,4564,4686,4630,4673,2738,4698,4631,4694,4567,2695,4594,2937,4585,4654,2684,2845,2510,2991,2528,2913,2623,2976,2869,3029,4609,4527,3017,3009,2638,3011,2546,3022,2649,2980,2573,2761,2983,2788,2988,3019,2791,2517,4558,4709,2920,4543,4573,4531,2909,2837,4610,2571,3028,2579,3041,2787,2840,2908,2534,2723,2634,2842,2828,2798,4689,4547,4578,4602,2554,3036,2747,2597,2915,2895,2704,3008,2764,2818,2910,2961,2525,2841,2808,2803,4560,4552,4562,4549,2545,2918,2663,2900,2683,4653,2951,2699,2994,2906,2590,2848,2973,4571,4577,4707,4517,4640,4629,4685,4660,4550,4664,2959,2940,2667,2633,2680,4528,4620,4619,4687,4680,4681,3000,4647,2740,2981,2726,2690,2934,2882,2553,2963,2689,4704,4641,4679,2591,2956,2866,2945,2541,2775,2636,2589,2688,2642,2878,2673,2902,2816,4621,4563,4553,4644,4645,4695,4639,2865,3003,2715,2611,2662,2592,3034,2943,3025,2544,4691,4603,4592,2708,2898,2585,2717,2629,3016,2768,3015,3046,2926,4649,2767,2932,2711,2954,4588,4536,4575,2827,2872,2756,2665,2929,2580,2669,2824,2701,4648,4697,4638,2923,2873,2925,2559,2780,2609,2986,2935,2784,2987,3010,2682,2975,4690,4646,4678,4606,4643,4703,4537,4597,4613,4659,4566,2539,2796,2593,2746,4542,4661,2957,2807,2941,2658,2802,2855,2512,2861,3001,4625,2995,2985,2647,4548,2931,2958,2696,3014,4657,4699,2730,2825,2793,2731,2635,2548,2832,2810,2885,4565,4554,4514,4530,2874,2852,2964,2800,2859,2886,2789,2606,2601,2631,2664,2596,2618,2891,2645,2938,4650,4540,4622,2922,2565,3045,2672,4524,4601,2531,2890,2687,2655,2809,2582,2719,2605,2558,2856,2578,2759,3021,2584,2692,2509,3037,2588,2863,2703,2713,2568,4688,4596,4551,4705,4532,2952,2743,2748,2702,2607,4706,4656,4529,4667,2646,2581,2977,2567,2896,2760,4662,4591,2776,2854,2774,2514,2916,2970,2933,2615,2595,2562,2936,3027,2602,2912,4676,4561,2968,2721,2604,2773,2577,4635,4598,4521,4519,2651,2782,2619,2661,2543,2893,2804,2867,2516,2538,2519,2942,2921,3023,2769,2752,2603,3039,2654,4637,4623,4586,2765,2819,2714,2817,4702,4555,2529,4682,2924,2694,2742,2822,3043,2666,2547,4615,2997,2846,3040,2706,2612,2907,2540,2583,2691,2632,2753,2919,2676,2656,3005,4522,4608,4632,4526,4534,4617,4580,2657,2989,2598,2650,4583,4669,3004,2889,2815,2871,2535,2610,2639,2826,2917,3018,2530,2801,2728,2736,2834,2572,2833,2526,2771,2556,2698,2613,2550,2700,2971,2727,4658,2712,4655,2875,2996,2678,2781,2766,2790,2814,2744,2594,2779,2993,2527,2648,2928,4668,2686,2625,2868,3033,2887,2897,2720,2739,2671,2620,2955,2520,4525,4627,4663,2979,2974,3042,3035,2799,2532,2652,2998,2797,3038,2901,2883,2644,2794,2616,2877,3044,2831,3030,2881,2518,2733,2677,2930,2574,2599), 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 (2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]