Table of Contents
SQL - Left (Outer) Join
About
A “Left Outer” join is interpreted as show me all data from the left table and any matches with the right table.
In some databases LEFT JOIN is called LEFT OUTER JOIN.
Articles Related
Example
| table1 (inner set) | table2 (outer set) |
|
|---|---|---|
| Column ID | Column ID | Column ID_2 |
| A | A | |
| B | B | A |
| D | C | C |
gerardnico@orcl>select table1.id "ID_table1", table2.id "ID_table2" 2 FROM table1 LEFT OUTER JOIN table2 3 ON table1.id = table2.id; ID_table1 ID_table2 ---------- ---------- A A B B D
All the data from the table1 appears even if for the value D, we don't have any match with the table1.