PL/SQL Right Join

The PL/SQL RIGHT JOIN return all rows from the right table, although there are no matches in the left table.

Phones table

PHONE_IDPHONE_NAMEBRAND_ID
1Galaxy Note Edge1
2N910 Galaxy Note 41
3Galaxy S5 Duos 4G1
4iPhone 5S2
5iPhone 6 Plus2
6930 Lumia3
7830 Lumia3

Phone_orders table

ORDER_IDPHONE_ID
13
23
34
46

Right Join example

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

Output

PHONE_IDPHONE_NAMEORDER_ID
3Galaxy S5 Duos 4G1
3Galaxy S5 Duos 4G2
4iPhone 5S3
6930 Lumia4