Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
My brain is quiting on me!
Message
 
 
To
02/12/2009 14:01:14
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01437205
Message ID:
01437327
Views:
35
>FaultsLog.fkEventsLog have some NULL value
>
>The result is correct because:
>OR with NULL element CAN return true
>AND with NULL return false
>
>Example:
>
>CREATE TABLE #TEST (A INT NULL)
>INSERT INTO #TEST (A) VALUES (1)
>
>SELECT 'YES' WHERE 2 NOT IN (SELECT A FROM #TEST)
>
>INSERT INTO #TEST (A) VALUES (NULL)
>
>SELECT 'NONE' WHERE 2 NOT IN (SELECT A FROM #TEST)
>
>DROP TABLE #TEST
>
>SELECT 'YES' WHERE 2 NOT IN (1)
>SELECT 'NONE' WHERE 2 NOT IN (1,NULL)
>
Very nice explanation!
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform