I have a customers table with 100 rows and an orders table. I want every customer listed with the number of orders placed in 2026, including customers with none. SELECT c.name, COUNT(*) FROM customers c LEFT JOIN orders o ON o.customer_id = c.id WHERE o.order_date >= '2026-01-01' GROUP BY c.name returns only 63 rows.
I thought LEFT JOIN keeps all rows from the left table. Why are the other 37 customers missing, and what exactly is the difference between the join types?




