PostgreSQL SyntaxLesson 33Free preview
PostgreSQL RIGHT JOIN
This lesson is part of PostgreSQL · All levels
Summary
RIGHT JOIN is the opposite of LEFT JOIN because it maintains the entire row on the right table. When the left table row has no pair, the column is filled. Logically it is the same as LEFT JOIN where the table position is changed, so many developers prefer to write LEFT JOIN to make the sequence easier to read.
Key points
- RIGHT JOIN maintains the entire right-hand row of the table.
- The left-hand column becomes NULL when no pair is found.
- Logically equivalent to LEFT JOIN with the order of the table exchanged.
- Most cases are more obvious when written as LEFT JOIN.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.