PL/SQL Full Join

The PL/SQL FULL JOIN returns all rows from left table and right table even if the condition is not fulfilled.

Phones table

PHONE_IDPHONE_NAME
1Galaxy Note Edge
2N910 Galaxy Note 4
3Galaxy S5 Duos 4G
4iPhone 5S
5iPhone 6 Plus
6930 Lumia
7830 Lumia

Phone_orders table

ORDER_IDPHONE_ID
13
23
34
46

Full Join example

 
SELECT p.phone_id, p.phone_name, o.order_id
FROM phones p FULL JOIN phone_orders o
ON p.phone_id=o.phone_id
ORDER BY p.phone_id, o.order_id;

Output

PHONE_IDPHONE_NAMEORDER_ID
1Galaxy Note Edge(null)
2N910 Galaxy Note 4(null)
3Galaxy S5 Duos 4G1
3Galaxy S5 Duos 4G2
4iPhone 5S3
5iPhone 6 Plus(null)
6930 Lumia4
7830 Lumia(null)