limit 1,3
index 从0开始 limit 1,3 也就是从第二位开始 取3位
select IFNULL ((select distinct (a.Salary) from Employee a order by a.Salary desc limit 1,1),null) as SecondHighestSalary
第N高、
limit中不能做加减操作
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
set N=N-1;
RETURN (
# Write your MySQL query statement below.
select ifnull((select distinct Salary from Employee order by Salary desc limit N,1 ),null)as Salary
);
END