Full Join Example:
SELECT * FROM employee e FULL JOIN department d
ON e.DEP_ID = d.DEP_ID
ORDER BY e.employee_id ;
Employee table:
EMPLOYEE_ID | NAME | DEP_ID |
---|---|---|
1 | EMPLOYEE_1 | 21 |
2 | EMPLOYEE_2 | 22 |
3 | EMPLOYEE_3 | 23 |
4 | EMPLOYEE_4 | 24 |
5 | EMPLOYEE_5 |
Department table:
DEP_ID | DEP_NAME |
---|---|
21 | DEP_21 |
22 | DEP_22 |
23 | DEP_23 |
24 | DEP_24 |
25 | DEP_25 |
Full Join Result:
EMPLOYEE_ID | NAME | DEP_ID | DEP_ID | DEP_NAME |
---|---|---|---|---|
1 | EMPLOYEE_1 | 21 | 21 | DEP_21 |
2 | EMPLOYEE_2 | 22 | 22 | DEP_22 |
3 | EMPLOYEE_3 | 23 | 23 | DEP_23 |
4 | EMPLOYEE_4 | 24 | 24 | DEP_24 |
5 | EMPLOYEE_5 | |||
25 | DEP_25 |