Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting with nulls
Message
 
À
13/08/2013 14:00:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 6.5 and older
Application:
Web
Divers
Thread ID:
01580404
Message ID:
01580405
Vues:
50
This message has been marked as the solution to the initial question of the thread.
>Hi All -
>
>I have this query defined.
>
select * from TIP_Ledger where FundType='RTA' and isnull(checknumber,'')=''
>
>Interestingly, it produces the records specified and also those where checknumber is blank but not null. This is good but a surprise to me. I was wondering if it can be relied upon or is it just a quirk.
>
>Thanks for your shared knowledge.

Of course you will get blank checknumbers too.
The whole point if ISNULL() function is to convert NULLs to something that isn't null.
if you want to get ONLY NULLs:
select * from TIP_Ledger where FundType='RTA' and checknumber IS NULL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform