Skip to content

The LEFT JOIN that became an INNER JOIN

This is meant to list every customer with their orders from this year, including customers who ordered nothing. Customers with no orders are missing from the result.

sql SELECT c.name, o.total FROM customers c LEFT JOIN orders o ON o.customer_id = c.id WHERE o.created_at >= '2026-01-01';

Why?