176. 第二高的薪水
题解
薪水相等的排名相同,所以要用 distinct
去重,使用 ifnull
函数实现查询结果为空则返回 null
select ifnull(
(select distinct Salary from Employee order by Salary desc limit 1, 1),
null)
as SecondHighestSalary;
薪水相等的排名相同,所以要用 distinct
去重,使用 ifnull
函数实现查询结果为空则返回 null
select ifnull(
(select distinct Salary from Employee order by Salary desc limit 1, 1),
null)
as SecondHighestSalary;
让时间为你证明