Pages

Thursday, November 5, 2015

very useful functions: ISNULL and NULLIF -


this we can use when we want to replace null with your own value.

ISNULL

columnName - is null here
my value -- your custom value

select ISNULL(columnName ,'my value') as newvalue, *  from  table



--------------------------------------------------------------------------------------------



 NULLif

here function will display NULL if columnName mataches with yourValue
else it will display column's value from table

select NULLif( columnName,'yourValue') as NEWcurrencycode, * from  table


No comments:

Post a Comment