MySQL SQLLesson 31Free preview
MySQL RIGHT JOIN
This lesson is part of MySQL · All levels
Summary
RIGHT JOIN (or RIGHT OUTER JOIN) is the opposite of the position of LEFT JOIN: the entire row of the right table is guaranteed to appear, even if it has no pair in the left table. The row that has no pair will display the left table column as NULL. In practice, RIGHT JOIN can be rewritten as LEFT JOIN by changing the table position to make it easier to read.
Key points
- RIGHT JOIN guarantees the entire right table line to appear
- The left-hand table column becomes NULL when no pair is found
- Logically it's equal to LEFT JOIN when the second position of the table is exchanged.
- The right table is the one written after the word JOIN
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.