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(261,156,190,239,180,255,228,253,3294,3225,3229,3222,3281,3191,3276,3227,3284,3228,3286,3214,3275,3271,3216,3279,3215,3272,3280,3282,3290,3270,3221,3226,3283,3223,3230,3277,3291,3273,3224,3194,3220,3278,3192,3213,3274,252,234,256,233,230), 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 (156,180,190,228,230,233,234,239,252,253,255,256,261,3191,3192,3194,3213,3214,3215,3216,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3286,3290,3291,3294) GROUP BY po.products_options_name, pov.products_options_values_name ORDER BY po.products_options_name, pov.products_options_values_sort_order]