ISNULL : Replaces NULL with the specified replacement value.
NULLIF : Returns a null value if the two specified expressions are equal.
COALESCE : Returns the first non-null argument.(msdn: Evaluates the arguments in order and returns the current value of the first expression that initially does not evaluate to NULL).
Here are the examples and it's results:
SELECT ISNULL(null,1) --Result: 1 SELECT NULLIF(1,1) --Result: NULL SELECT COALESCE(1,null,null,null) --Result: 1 SELECT COALESCE(null,2,3,4) --Result: 2 SELECT COALESCE(null,null,3,4) --Result: 3 SELECT COALESCE(null,null,null,4) --Result: 4 SELECT ISNULL(NULLIF(COALESCE(null,null,null,4),4),1) --Result: 1
It is not my first time to pay a quick visit this site, i aam visiting thhis web age
ReplyDeletedailly and take nice information from here every day.