Filter query results using query on different table

suggest change

This query selects all employees not on the Supervisors table.

SELECT *
FROM Employees
WHERE EmployeeID not in (SELECT EmployeeID
                            FROM Supervisors)

The same results can be achieved using a LEFT JOIN.

SELECT *
FROM Employees AS e
LEFT JOIN Supervisors AS s ON s.EmployeeID=e.EmployeeID
WHERE s.EmployeeID is NULL

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Subqueries:
*Filter query results using query on different table

Table Of Contents