Skip to content

1978. Employees Whose Manager Left the Company 👍

1
2
3
4
5
6
7
8
9
SELECT Employee.employee_id
FROM Employees AS Employee
LEFT JOIN Employees AS Manager
  ON (Employee.manager_id = Manager.employee_id)
WHERE
  Employee.salary < 30000
  AND Employee.manager_id IS NOT NULL
  AND Manager.employee_id IS NULL
ORDER BY 1;