If you are like me when it comes to developing SQL solutions, you will inevitably use ISNULL function but did you know about NULLIF function. This function is almost the opposite of ISNULL. NULLIF takes two inputs.
Let’s look at a how to use this function. Suppose you have two columns and want to return null if both inputs are the same and returns Exp1 if they do not match.
For performance check out this article.
http://blog.jerrynixon.com/2010/02/performance-of-sqls-nullif-function.html
One of the best places to use NULLIF is to suppress the zero divide error:
NULLIF is equal to a searched CASE expression in which the two expressions are equal and the resulting expression is NULL. -per Microsoft.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!