SQL -Right Outer Join or Right Join
The RIGHT JOIN /RIGHT OUTER returns all records from the Right table and the matched records from the Left table
A (+) = B
If no matching rows found in the Left table, NULL are used.
SELECT select_List FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;
Consider Employee table having below records.
Consider Department table having below records.
List Employees that doesn’t belong to any department
Select e1.EmployeeID ,e1.Employee_FirstName ,e1.Employee_LastName ,e1.City , d.departmentID , d.departmentName
from Employee e1 RIGHT JOIN Department d on e1.departmentID=d.departmentID
WHERE d.departmentName IS NULL