Sunday, November 20, 2016

Is it possible to compare NULL value to NULL?

Quation:

SELECT  Case When NULL=NULL Then 1
                 ELSE 0 END as result

ANS: 0

my observation:

NULL means just nothing and NULL is not equal to zero or some other value or empty string. If you need to attach a specific meaning to NULL then missing or absent data. Nothing cannot be the same as nothing. Nothing cannot be compared to nothing. Because case condition fails then it will return 0.

Why it will be 0 ,if you have any ideas let me know 

No comments:

Post a Comment