NULLIF 与ISNULL的区别与记法

nullif (A, B)

-->return null if A equals B (, else return A)

eg: 

select nullif('','')  --null

isnull(A, B)

--> if A is null, return B (; else return B)

eg: 

select isnull(null,null)  --null
select isnull(3,null)  --3
select isnull(null,'44')  --44
select isnull('33','44')  --33

猜你喜欢

转载自jz-2017.iteye.com/blog/2375668