Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- merge
- L1정규화
- sql
- 온라인협업
- github
- 선형 모형
- 편향-분산 교환
- 교차 엔트로피
- HTML
- branch
- 클라우드컴퓨팅
- hackerrank
- programmers
- full request
- PYTHON
- L2정규화
- 깃헙협업
- window function
- leetcode
- coding
- RLIKE
- mysql
- CSS
- conflict
- 버전충돌
- AWS
- early stopping
- elastic net
- Git
- 코딩공부
Archives
- Today
- Total
Im between cherry
LeetCode | MySQL | 177. Nth Highest Salary 본문
177. Nth Highest Salary
leetcode.com/problems/nth-highest-salary/
Nth Highest Salary - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
RETURN(
SELECT IF(COUNT(sub.Salary) < N, NULL, MIN(sub.Salary))
FROM(
SELECT DISTINCT e.Salary
FROM Employee AS e
ORDER BY Salary DESC
LIMIT N
)sub
);
END
'데이터분석 > practice_query' 카테고리의 다른 글
LeetCode | MySQL | 185. Department Top Three Salaries (0) | 2020.09.09 |
---|---|
LeetCode | MySQL | 184. Department Highest Salary (0) | 2020.09.08 |
LeetCode | MySQL | 180. Consecutive Numbers (0) | 2020.09.08 |
LeetCode | MySQL | 177. Nth Highest Salary (0) | 2020.09.03 |
Programmers | MySQL | DATETIME에서 DATE로 형 변환 (0) | 2020.09.02 |
Comments