Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ff5c5e3

Browse files
committed
배수빈: [SQL] Nth Highest Salary_250103
1 parent 57364b5 commit ff5c5e3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
2+
BEGIN
3+
SET N = N-1;
4+
RETURN (
5+
# Write your MySQL query statement below.
6+
# Employee 테이블에서 n번째로 큰 급여를 반환하는 query를 작성
7+
# 만약에 n번째로 큰 급여 정보가 없다면, NULL을 반환
8+
SELECT DISTINCT salary
9+
FROM Employee
10+
ORDER BY salary DESC
11+
LIMIT 1 OFFSET N
12+
);
13+
END

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /