SQL Subquery in WHERE clause


Example

Use a subquery to filter the result set. For example this will return all employees with a salary equal to the highest paid employee.

SELECT *
FROM Employees
WHERE Salary = (SELECT MAX(Salary) FROM Employees)