176-Second Highest Salary

2017-12-27  本文已影响13人  篮子always

语言:sql


v1:

select Salary as SecondHighestSalary from Employee order by Salary desc limit 1,1

结果:未通过,因为为空时,和期待的结果null不同
v2:

SELECT (SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT 1,1) as SecondHighestSalary;
上一篇下一篇

猜你喜欢

热点阅读