Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strange
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01461804
Message ID:
01461805
Vues:
61
>Hi everybody,
>
>I'm trying to figure out some strange phenomena.
>
>I have a huge database. I have two similar written queries. One produces 34447 records and another produces 30242.
>
>So, I want to see the difference and first I tried
>
>select * from bigger query
>EXCEPT
>select * from lesser query
>
>and I got 0 results.
>
>I also tried
>
>select * from bigger query where not exists (select 1 from lesser query)
>
>and again I got 0 results.
>
>Can you please explain it to me.
>
>BTW, the lesser query is written quite strangely and the reason I wrote another query is because I can not understand the original one.
>
>Thanks in advance.

What if you use the old way:
SELECT BiggerQuery.*
FROM BiggerQuery
LEFT JOIN LesserQuery ON CommonFields
WHERE LesserQuery.SomeField 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