Home Forums Article Discussions Article Discussions by Author Discuss content posted by Bhuvnesh Play with NULLIF RE: Play with NULLIF
psharma-1140604
SSC Journeyman
Points: 88
More actions
June 22, 2010 at 4:18 am
#1183195
When you cast(blank('') as int), it returns 0. so when you compare 0 with 0 nullif returns NULL.
declare @a smallint
set @a= 0
select nullif(@a,0)
Ans: NULL