What IS Semi Join IN SQL SERVER?
A semi-join between two tables returns rows that match an EXISTS subquery without duplicating rows from the left side of the predicate when multiple rows on the right side satisfy the criteria of the subquery.
Example:-
Let assume we have two table table1(Employee) and table2 (Department).
now table 1 has 3 fields Empid, EmpName, Department and table 2 has 2 field DepartmentName, Manager.
SELECT
*
FROM
Employee
WHERE
EXISTS (
SELECT
1
FROM
Dept
WHERE
Employee.DeptName = Dept.DeptName
)