LEFT JOIN or LEFT OUTER JOIN in SQL Server

Fill In The Blank
Views 431

Answer:

LEFT JOIN or LEFT OUTER JOIN
Now, let's say, I want all the rows from the Employees table, including JAMES and RUSSELL records. I want the output, as shown below.

Code:


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

OR


SELECT Name, Gender, Salary, DepartmentName
FROM tblEmployee
LEFT 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.