RIGHT JOIN IN SQL
The right join sql return all rows from the right table. It also considered the mathced values from left table but if there is no
matching in both the table then it returns to NULL.
Syntax:
SELECT col_name(s)
FROM tab1
RIGHT OUTER JOIN tab2
ON tab1.col_name=tab2.col_name;
Tab 1
E_id |
E_NAME |
E_Age |
501 |
Mike |
42 |
502 |
Robert |
34 |
503 |
KARL |
32 |
504 |
Benn |
39 |
Tab 2
P_Id |
P_Date |
E_SALARY |
501 |
05-03-2018 |
15400 |
502 |
05-03-2018 |
14200 |
503 |
05-03-2018 |
16000 |
504 |
05-03-2018 |
17500 |
Result After execution
P_id |
E_name |
501 |
Mike |
502 |
Robert |
503 |
KARL |
504 |
Benn |