ice rabbit programming

[LeetCode] Second Highest Salary 본문

PS/LeetCode

[LeetCode] Second Highest Salary

판교토끼 2020. 5. 1. 23:38

https://leetcode.com/problems/second-highest-salary/

 

Second 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

두 번째로 큰 값을 찾는 문제였다. MAX 값보다 작은 값들 중에 MAX를 Select하였다.

# Write your MySQL query statement below
SELECT MAX(Salary) as SecondHighestSalary
FROM Employee
WHERE Salary < (SELECT MAX(Salary) From Employee);