题目 思路 查询出来所有的薪水 去重后 进行降序排列根据limit进行分页 找到第二行的一条数据用ifnull函数处理查找不到结果为空的情况 使用方法 ifnull(a,b) 如果不为null则返回a,为null返回b, 代码 # Write your MySQL query statement below select ifnull((select distinct salary from Employee order by salary desc Limit 1,1),null) as SecondHighestSalary