SQL FULL JOIN

FULL JOIN combines the values of the first table to the values of the second table. Always return the rows of two tables, but do not meet the condition.

The judgment FULL JOIN is the union of LEFT JOIN and RIGHT JOIN

SELECT * FROM table1 FULL JOIN table2 WHERE table1.column1 = table2.column1

FULL JOIN SQL Example

pernamesurnamenicknamedep
1HARRYCLARKWHITE1
2HARRYSMITHJOHNSON2
3JOHNBROWNANDERSON4

table "departments" with primary key "dep"

depdepartment
1ADMINISTRATION
2COMPUTER
3BUSINESS
SELECT name, surname, department FROM people FULL JOIN departments WHERE people.dep = departamentos.dep

namesurnamedepartment
HARRYCLARKADMINISTRATION
HARRYSMITHCOMPUTER
JOHNBROWN
BUSINESS