Home / Questions / FULL JOIN or FULL OUTER JOIN in SQL Server
Explanatory Question

FULL JOIN or FULL OUTER JOIN in SQL Server

👁 511 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

Join Employee table
Figure:

Cross join in sql server
Figure:

FULL JOIN or FULL OUTER JOIN
I want all the rows from both the tables involved in the join. The query output should be, as shown below.

Full Join in SQL SERVER
Figure:

Code:


SELECT Name, Gender, Salary, DepartmentName
FROM tblEmployee
FULL OUTER JOIN tblDepartment
ON tblEmployee.DepartmentId = tblDepartment.Id

OR


SELECT Name, Gender, Salary, DepartmentName
FROM tblEmployee
FULL JOIN tblDepartment
ON tblEmployee.DepartmentId = tblDepartment.Id

Note: