FULL JOIN or FULL OUTER JOIN in SQL Server

Fill In The Blank
Views 510

Answer:

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:

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of SQL, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.