In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'w-i_softair-shop_net_1.x.id'; this is incompatible with sql_mode=only_full_group_by(No Description) sql: SELECT COUNT(p.id) FROM products p JOIN productoffers o ON p.id = o.product_id JOIN products_categories AS pc ON pc.product_id=p.id WHERE p.parent_id = 0 AND p.enabled = 1 AND p.hidden = 0 AND offers > 0 AND o.percentagesaved > 0 AND o.price > 200 AND o.id IN (SELECT x.id FROM productoffers x WHERE x.product_id = p.id HAVING MIN(x.price)) AND pc.category_id IN (SELECT id FROM categories WHERE bestsellerspecialoffers =1) AND 1 = 1 ORDER BY p.salesrank DESC LIMIT 50