programplug Logo

SQL Full Joins

Full Joins In SQL

The SQL full joins is the combination of both right and left outer joins.
The joined table contain all records from both the tables and fill in NULL on the place of matches not found.

SELECT tab1.col1, tab2.col2...
FROM tab1
ON tab1.common_field = tab2.common_field;
Tab 1
Shift_id E_NAME
201 Robert
202 Rock
203 Johnson
204 Paul
Tab 2
P_id E_code
201 1342
202 2486
After join the table we get:

Shift_id E_NAME E_code
201 Robert 1342
202 Rock 2486
203 Johnson null
204 Paul 1342