PostgreSQL SyntaxLesson 32Free preview
PostgreSQL LEFT JOIN
This lesson is part of PostgreSQL · All levels
Summary
LEFT JOIN retains the entire row from the left table, although it does not find a match in the right table. The column in the right table will contain NULL when the pair is not present. This pattern is very useful for finding data that has no relationship yet, like customers who have never ordered.
Key points
- LEFT JOIN displays all the left table rows even without a pair.
- The right-hand table column becomes NULL if no match is found.
- It's useful to find data that doesn't have a relationship.
- The filter on the right table should be written on ON so that the LEFT property does not disappear.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.