select(
if(
(select count(e.Salary) from (select distinct e.Salary from Employee e) e)>=N,
(
select min(e.Salary)
from (select distinct e.Salary from Employee e order by e.Salary desc limit N) e
)
,
null
)
)
上面sql语句中 e 是必须的