编写一个 SQL 查询,获取 Employee 表中第二高的薪水(Salary) 。
SQL查询应该返回第二高的薪水。如果不存在第二高的薪水,那么查询应返回 null。
select (select distinct salary from employee order by salary desc limit 1, 1) as SecondHighestSalary;
select ifnull((select distinct salary from employee order by salary desc limit 1, 1), null) as SecondHighestSalary;