ISNULL 两种写法,得到两种结果,返回空记录与null

select isnull(salary,null) as SecondHighestSalary
from
employee
order by salary desc
offset 1 rows
fetch next 1 rows only
 
结果是空记录

select isnull((
select salary
from
employee
order by salary desc
offset 1 rows
fetch next 1 rows only)
,null) as SecondHighestSalary
 
结果是null
 
posted @ 2024-04-08 00:04  yinghualeihenmei  阅读(10)  评论(0编辑  收藏  举报