Leetcode Note: MySQL - Employees Whose Manager Left the Company

Employees Whose Manager Left the Company - LeetCode
https://leetcode.com/problems/employees-whose-manager-left-the-company/

  • MySQL で取り組んだメモ

回答

MySQL - using NOT IN - Employees Whose Manager Left the Company - LeetCode
https://leetcode.com/problems/employees-whose-manager-left-the-company/solutions/1419351/mysql-using-not-in/

SELECT employee_id FROM Employees
WHERE manager_id NOT IN (SELECT employee_id FROM Employees)
AND salary < 30000
ORDER BY employee_id;