SQL SERVER

What is Advanced Joins in SQL?

What is Advanced Joins in SQL
Avatar of shohal
Written by shohal

Advanced Joins in SQL

Advanced join will provide the non matching row (null) value from the SQL join.

Inner , Left and Right Join Will be added on where table is null to the output of Advanced Joins.

Full Join will added on Where table1.table2 is null or table2.table1 is null to the output of Advanced Joins.

In this session we will learn about

  1. Advanced or intelligent joins in SQL Server
  2. Retrieve only the non matching rows from the left table
  3. Retrieve only the non matching rows from the right table
  4. Retrieve only the non matching rows from both the left and right table

Considers Employees (tblEmployee) and Depart

Employee Table (tblEmployee)

What is Advanced Joins in SQL? | TechTweet

Departments Table (tblDepartment)

What is Advanced Joins in SQL? | TechTweet

How to retrieve only the non matching rows from the left table. The output should be as shown below:

What is Advanced Joins in SQL? | TechTweet

Query:
SELECT       Name, Gender, Salary, DepartmentName
FROM           tblEmployee E
LEFT JOIN   tblDepartment D
ON                 E.DepartmentId = D.Id
WHERE        D.Id IS NULL ——-(Advanced Join)—–

What is Advanced Joins in SQL? | TechTweet

How to retrieve only the non matching rows from the right table

What is Advanced Joins in SQL? | TechTweet

Query:
SELECT         Name, Gender, Salary, DepartmentName
FROM             tblEmployee E
RIGHT JOIN    tblDepartment D
ON                   E.DepartmentId = D.Id
WHERE          E.DepartmentId IS NULL ——-(Advanced Join)—–

What is Advanced Joins in SQL? | TechTweet
What is Advanced Joins in SQL? | TechTweet

How to retrieve only the non matching rows from both the left and right table. Matching rows should be eliminated.

What is Advanced Joins in SQL? | TechTweet
What is Advanced Joins in SQL? | TechTweet

Query:
SELECT         Name, Gender, Salary, DepartmentName
FROM              tblEmployee E
FULL JOIN      tblDepartment D
ON                   E.DepartmentId = D.Id
WHERE          E.DepartmentId IS NULL ——-(Advanced Join)—–
OR                   D.Id IS NULL

What is Advanced Joins in SQL? | TechTweet

For More : https://www.youtube.com/watch?v=WnAYlaSTm5E&list=PLX2qHGPZlD6xm99MbNlyHKXy3lPG0HVTq&index=23

🚀
What is Advanced Joins in SQL? | TechTweet

If you’d like me to proceed with any of these, please just let me know from the site techtweet.xyz! Also if you need to learn something new than subscribe YouTube : ASP.NET With SQL SERVER

About the author

Avatar of shohal

shohal

I have profession and personal attachment with custom ERP Software development, Business Analysis, Project Management and Implementation almost (36) ,also Oracle Apex is my all-time favorite platform to developed the software. Moreover i have some website development experience with WordPress. For hand on networking experience DevOps and CCNA, it create me a full package. Here are some core programming language with networking course i have been worked: Oracle SQL ,PL/SQL,Oracle 19c Database , Oracle Apex 20.1,WordPress,Asp.Net ,MS SQL ,CCNA ,Dev Ops, SAP SD

Leave a Comment