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

 

 

你可能感兴趣的:(sql)