Coding Test

Leetcode - 176. Second Highest Salary

Indo Yoon

문제

Loading...
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.

정답

SELECT () AS ~ 를 쓰면  NULL값을 보존할 수 있다.

SELECT (
SELECT salary 
FROM employee
GROUP BY salary
ORDER BY salary DESC
LIMIT 1
OFFSET 1) AS SecondHighestSalary