1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'or038387_bsdnaen.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(154,185,235,153,178,254,177,222,152,229,232,3197,3211,3210,3234,3235,3293,3241,3242,3188,3207,3238,3240,3287,3219,3253,3259,3266,3260,3239,3256,3267,3206,3257,3202,3255,3232,3237,3198,3247,3200,3264,3248,3292,3262,3289,3263,3288,3231,3201,3195,3233,3217,3252,3203,3254,3208,3209,3212,3218,3249,3268,3250,3204,3246,3236,3196,3269,3251,3258,3265,3261,3193,3205,3245,3199,3244,3190,3189,3243,251,227,231,269,181,182,179,268,184,263), 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 (152,153,154,177,178,179,181,182,184,185,222,227,229,231,232,235,251,254,263,268,269,3188,3189,3190,3193,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3217,3218,3219,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3287,3288,3289,3292,3293) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]