728x90
반응형
self 조인 leetcode 문제
풀이
- 주의할 점은 a.managerId = b.id 임.
- a.managerId 가 3,4 = b 테이블과 비교했을 때, 1,2번이 조인 결과로 나옴.
select
a.name as Employee
from
Employee a inner join Employee b
on a.managerId = b.Id
where
a.salary > b.salary
;'algorithm > leetcode' 카테고리의 다른 글
| Leetcode 930.BinarySubarraysWithSum (0) | 2024.03.26 |
|---|---|
| [leetcode] Number of Islands 정리 (0) | 2022.01.28 |
| leetcode Reformat Department Table 풀이 (0) | 2020.09.29 |
| [LeetCode] ReverseInteger (0) | 2020.07.11 |
| [LeetCode] LongestSubstring (0) | 2020.07.11 |
댓글