leetcode 176. Second Highest Salary

查询第二大的数。

select MAX(Salary) as SecondHighestSalary from Employee where Salary != (select MAX(Salary) from Employee);

 

select IFNULL((select distinct Salary from Employee order by Salary desc limit 1, 1), NULL) as SecondHighestSalary;

 

posted on 2018-01-29 22:44  willaty  阅读(141)  评论(0编辑  收藏  举报

导航