Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
My brain is quiting on me!
Message
 
 
À
02/12/2009 14:01:14
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01437205
Message ID:
01437327
Vues:
34
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform