Keep all rows from the left table and match rows from the right table.
Section: Joins
Left join
sql
sql
SELECT c.customer_id, o.order_id
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.customer_id;Explanation
Rows without a match on the right side get NULLs for right-side columns.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Joins