select isnull(salary,null) as SecondHighestSalary from(select distinct salary,row_number()over(order by salary desc) rn from Employee ) temp where rn=2;

select isnull(salary,null) as SecondHighestSalary
from(select distinct salary,row_number()over(order by salary desc) rn
from Employee
) temp
where rn=2;

猜你喜欢

转载自www.cnblogs.com/wsq-blog/p/10952468.html