https://leetcode-cn.com/problems/second-highest-salary/
当不存在并且需要返回null的时候:
1.可以将查询的结果作为临时表
select (select DISTINCT Salary from Employee order by Salary desc limit 1,1) as SecondHighestSalary
2.可以使用 ifnull
SELECT
IFNULL(
(SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC LIMIT 1 ,1)
, NULL) AS SecondHighestSalary