题目链接
https://leetcode-cn.com/problems/second-highest-salary/
题解
注意几个sql语句的用法即可。
ifnull、desc、limit offset的用法见:https://www.cnblogs.com/OFSHK/p/14636382.html
AC代码
select ifnull(
(select distinct Salary from Employee
order by Salary desc
limit 1 offset 1),null) as SecondHighestSalary;