https://leetcode.com/problems/second-highest-salary/submissions/
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
select max(salary) as SecondHighestSalary from Employee
where salary < (select max(salary) from Employee);
/*
select salary as SecondHighestSalary from
(
select salary
from Employee
order by salary desc
limit 2
) as a
order by SecondHighestSalary asc
limit 1;
*/
728x90
반응형
'자료구조 알고리즘 > 코딩테스트' 카테고리의 다른 글
746. Min Cost Climbing Stairs (0) | 2022.05.31 |
---|---|
70. Climbing Stairs (0) | 2022.05.31 |
608. Tree Node (0) | 2022.05.30 |
1795. Rearrange Products Table (0) | 2022.05.30 |
1965. Employees With Missing Information (0) | 2022.05.30 |