select count(*) as cnt, quantity from basket WHERE productid = '' AND basket_session = '1b04e3ea179e0c3f931339e8ce5c6243' 1140 In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'artbarfu_db.basket.quantity'; this is incompatible with sql_mode=only_full_group_by