Leetcode Note: Mysql - Employees Earning More Than Their Managers

Employees Earning More Than Their Managers - LeetCode
https://leetcode.com/problems/employees-earning-more-than-their-managers/

  • MySQL で取り組んだメモ

所感

  • JOIN すれば抽出できそう

回答

[MYSQL] | 3 different ways [exists / join / subquery] - LeetCode Discuss
https://leetcode.com/problems/employees-earning-more-than-their-managers/discuss/727229/MYSQL-or-3-different-ways-exists-join-subquery

SELECT e.name as Employee
FROM Employee e
INNER JOIN Employee m
ON e.managerId = m.Id
WHERE e.salary > m.salary