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(1268,355,2388,6090,6137,6153,6210,6283,6321,6476,6488,6622,6745,6911,876,980,1271,1574,2155,5125,1642,4671,34,1817,2650,2922,3090,3510,4968,5178,5554,5606,3706,5679,2391,5240,340,2107,2421,2490,2801,3399,3679,4502,5505,5574,5790,50,2031,3172,3531,358,620,1445,1475,2397,2586,3663,3823,3861,4555,5748,4410,1342,137,260,313,1227,1981,2090,2156,2250,2580,2659,3139,3177,3384,3972,5075,5553,114,505,1037,3299,3319,3576,3584,3602,3636,4207,4745,5025,5044,5414,2966,664,1120,1287,1302,2053,2548,3420,3560,5491,5616,5688,5849,167,2745,4650,4744,445,595,1774,2198,3105,3321,1943,2365,3465,2036,224,231,309,366,1056,1058,1155,1580,2455,2730,2821,3356,3837,4090,4142,4216,5622,5657,5896,1944,493,2346,3144,3804,1515,4855,56,605,628,675,797,927,1090,1237,3050,3774,4308,4397,4753,4803,4898,4990,5874,3885,4846,5167,5404,541,2448,3085,5042,5873,596,995,1956,4974,5377,270,482,1238,1292,1379,1896,2084,2318,2564,2911,3080,3431,3617,3734,4286,5740,1387,1624,3036,3936,4780,5407,5507,5673,1053,2507,5881,2236,518,561,606,1225,1992,2456,2461,2855,3446,4608,5129,5391,6029,6646,278,747,1012,1283,2024,2200,3042,3984,4130,5207,1646,2372,5476,5603,5854,6406,6826,839,2068,3280,3678,3933,5109,5682,196,723,767,938,946,1019,1248,2656,2696,2972,3690,4088,4184,4985,5035,5117,5362,5405,5409,5701,5821,5841,221,2070,2321,2447,3551,3622,4114,5180,5792,5845,5951,141,232,417,438,658,711,888,971,990,1002,1403,1566,1615,1859,1969,2076,2767,3495,3517,3673,3985,4418,4871,5317,5626,5903,92,1220,1494,1571,2436,3041,3571,3719,4129,4356,4612,4804,5211,5295,708,1169,1826,2629,3683,3825,4076,4221,517,1217,2298,1380,1834,2692,587,3539,4250,4306,5356,5656,4793,1577,5744,1425,412,679,1884,3064,3075,3272,4867,5027,5425,6053,6296,6650,4628,6221,6773,174,560,2606,3260,5021,3608,4940,4737,5243,1793,1933,4636,4964,5865,1620,2266,1800,2407,3432,4056,5658,6019,6127,6402,6744,333,457,559,715,827,850,1071,1510,2211,2702,2897,3395,3570,3583,3639,3811,4014,4199,4404,4444,4591,4878,5636,5716,5982,2337,1658,4791,5723,33,310,500,674,1154,1383,1647,1704,1966,2011,2810,2839,2921,3550,3695,4831,5083,5517,5649,5715,5763,3847,75,154,1795,2037,2060,2285,2583,4367,4686,961,1482,1874,4698,5009,5023,5835,85,3149,3742,5433,5813,408,477,594,690,3415,368,1165,4280,48,923,983,1733,1,3355,5799,176,944,1366,1673,2431,3516,3965,4500,5255,5261,5514,5662,1590,1946,3103,5797,248,727,1333,1632,1779,2206,2646,2753,2957,3251,3475,4513,5604,1123,1226,194,475,1297,1680,1856,2342,2358,2589,3773,4458,4639,5653,5807,4373,2000,2323,2874,2907,2919,121,3817,5321,6204,6471,6532,6557,6641,6649,6670,6867,6010,6852,691,949,1722,2495,2726,2984,3096,3827,4346,4419,4618,4806,5004,5745,1162,1561,1761,1794,2067,2755,2891,4215,4339,4422,4941,5155,328,1539,1655,3009,2542,276,433,447,567,1042,1069,1158,1211,1685,1807,1925,2085,2115,2488,2713,2828,2949,2990,3072,3498,3730,3954,3957,4350,4386,4501,4545,4700,4748,4751,4891,4978,5342,5481,5530,5540,5704,5743,5769,5871,866,2280,5052,5097,376,1361,1678,1749,1819,1930,1958,2059,2677,3083,3157,4104,4122,4812,4844,4932,5265,5418,5739,1381,1825,2270,2514,3151,3225,4054,4530,5157,5345,755,5078,273,1152,2181,4033,3880,547,3740,1276,1307,1696,2314,5099,502,2865,2905,3931,4340,4548,4860,720,3180,619,710,731,1473,1730,1758,3452,3660,4039,4721,4773,5319,5323,4333,5504,308,2091,1263,1823,2561,905,1721,2376,2623,4374,5623,3633,109,748,2316,4300,4872,1459,3372,5346,411,618,1018,1246,1474,2320,2800,2962,3529,3699,4851,4854,5560,1976,4811,6191,6248,6481,6577,895,1434,1638,2790,3899,4510,4641,5232,5284,5468,5478,5,341,729,860,1289,1303,1677,1719,2476,2596,2739,3628,3793,3967,4027,4120,4264,4492,4648,4708,5102,5360,5633,1759,5301,814,1331,4890,2875,5411,6736,6902,22,184,590,918,1738,2220,3092,3250,3371,3789,4148,5062,247,4984,5908,650,1742,1076,2052,3940,2936,6300,6369,6348,6551,6725,6869,1926,2061,2423,2590,3214,4006,4633,1131,2622,538,2666,3923,4047,5493,1240,1257,1986,4382,4547,5124,5546,134,527,836,1209,2302,2616,2652,2832,2969,3218,3313,3437,3645,3728,4496,4554,4834,5056,5112,5268,5601,79,835,880,958,964,2001,2259,2843,3982,4078,4815,5128,5156,5570,5781,718,1538,2849,2976,3283,3870,4010,5169,5204,5565,1645,4152,5164,5262,428,452,1988,3281,3518,4401,4514,5374,374,1065,3070,3231,3582,3918,4543,5782,5960,4934,5892,384,4103), 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,48,278,518,561,606,747,923,983,1012,1165,1225,1263,1283,1646,1733,1823,1992,2024,2200,2372,2456,2461,2561,2650,2855,2922,2936,3042,3355,3446,3510,3706,3984,4130,4280,4608,5129,5178,5207,5476,5603,5606,5679,5799,5854,411,538,547,814,1152,1276,1331,1361,2666,2875,3180,3633,4047,4890,5078,5,92,184,276,328,417,433,438,447,567,711,731,767,918,938,1002,1019,1158,1162,1220,1248,1494,1571,1678,1719,1730,1749,1793,1807,1884,1976,2059,2070,2436,2476,2488,2507,2656,2696,2713,2739,2767,2828,2972,3009,3041,3083,3272,3498,3517,3571,3628,3690,3789,3793,3954,3985,4088,4129,4148,4184,4215,4356,4422,4501,4612,4648,4721,4737,4748,4804,4811,4871,4891,4964,5027,5035,5062,5102,5117,5180,5211,5243,5265,5295,5342,5405,5481,5540,5633,5704,5769,5792,5841,5865,5951,1268,1425,1577,2068,3280,3678,4793,5682,2391,5240,247,1958,2596,4333,4984,5360,5504,5908,22,34,141,196,221,232,341,502,587,590,658,708,723,729,866,876,888,905,946,971,990,1131,1169,1289,1303,1403,1539,1561,1566,1615,1620,1655,1677,1721,1738,1742,1761,1794,1826,1859,1969,2067,2076,2220,2266,2280,2321,2376,2447,2622,2623,2629,2865,2905,3092,3250,3371,3495,3539,3608,3622,3673,3683,3825,3931,3967,4027,4076,4114,4120,4221,4250,4306,4340,4374,4386,4418,4548,4628,4860,4940,4941,4985,5052,5125,5317,5356,5362,5409,5623,5626,5656,5701,5821,5881,5903,154,333,457,559,618,715,827,850,1018,1071,1246,1307,1380,1474,1510,1658,1696,1834,2181,2320,2337,2692,2702,2800,2897,2962,3395,3529,3570,3639,3699,3740,3811,4014,4033,4199,4591,4791,4854,4878,5099,5493,5560,5636,5723,5982,33,56,85,134,137,176,194,231,248,310,313,340,358,366,368,374,445,493,541,595,620,718,727,797,836,880,927,949,958,964,1056,1065,1120,1154,1155,1209,1237,1240,1257,1292,1297,1342,1445,1475,1515,1538,1590,1624,1632,1673,1704,1722,1779,1825,1856,1943,1944,1946,1956,1986,2001,2036,2053,2107,2156,2206,2250,2302,2318,2323,2346,2397,2431,2455,2490,2564,2580,2589,2652,2730,2745,2753,2801,2810,2849,2874,2921,3096,3103,3139,3151,3251,3313,3319,3321,3356,3420,3431,3465,3516,3584,3602,3617,3636,3645,3663,3695,3774,3823,3827,3861,3918,3982,4010,4054,4078,4103,4142,4286,4308,4346,4373,4382,4397,4410,4458,4502,4513,4530,4543,4547,4618,4639,4744,4753,4780,4815,4834,4898,4934,5004,5025,5056,5083,5112,5124,5167,5169,5261,5345,5377,5404,5433,5505,5507,5514,5517,5546,5574,5601,5616,5649,5657,5673,5688,5715,5740,5790,5797,5813,5896,2583,4641,4686,5319,5346,5468,50,79,114,121,167,224,260,270,309,384,408,475,477,482,500,505,527,594,596,605,628,664,674,675,690,691,835,944,995,1037,1058,1090,1123,1226,1227,1238,1287,1302,1333,1366,1379,1381,1383,1387,1580,1647,1680,1774,1896,1966,1981,2000,2011,2031,2084,2090,2198,2259,2270,2342,2358,2365,2421,2448,2495,2514,2548,2586,2616,2646,2659,2726,2821,2832,2839,2843,2907,2911,2957,2966,2969,2976,2984,3036,3050,3070,3080,3085,3105,3144,3149,3172,3177,3218,3225,3231,3283,3299,3384,3399,3415,3437,3475,3531,3550,3560,3576,3582,3679,3728,3734,3742,3773,3804,3817,3837,3870,3885,3936,3965,3972,4090,4207,4216,4419,4496,4500,4554,4555,4650,4745,4803,4806,4831,4846,4855,4974,4990,5042,5044,5075,5128,5156,5157,5204,5255,5268,5321,5407,5414,5491,5553,5565,5570,5604,5622,5653,5662,5745,5748,5763,5781,5782,5807,5849,5873,5874,5892,5960,75,619,650,748,895,961,1482,1874,1926,2037,2061,2285,2423,2590,4039,4300,5009,517,710,755,1076,1217,1434,1459,1473,1638,1795,2052,2060,2298,2790,3372,3899,3940,4367,4510,5232,5284,5391,5478,3660,174,308,355,560,720,1800,1817,1819,2091,2407,2606,2677,3090,3260,3432,4056,4773,4812,4968,5021,5097,5323,5418,5554,5658,5739,428,452,3281,4401,5164,5262,412,679,860,1042,1053,1069,1211,1685,1759,2085,2115,2236,2542,2755,2891,2949,2990,3064,3072,3075,3551,3719,3730,3957,4264,4339,4350,4492,4545,4700,4708,4751,4867,4978,5109,5155,5301,5425,5530,5716,5743,5845,5871,1645,1988,3518,4152,4514,5374,109,376,980,1271,1574,1642,1758,1930,2155,2316,2919,3214,3452,3847,4006,4122,4633,4671,4698,4844,4872,5023,5835,273,2211,2314,3157,3583,3880,3923,4104,4404,4444,4851,4932,839,2388,3933,5744,1925,1933,4636,5411,6019,6402,6283,6321,6488,6773,6911,6204,6557,6053,6650,6736,6090,6137,6153,6210,6221,6476,6622,6745,6296,6902,6300,6471,6670,6010,6029,6248,6481,6369,6646,6852,6191,6577,6127,6744,6826,6348,6532,6551,6867,6406,6641,6649,6725,6869) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]