Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EXISTS
Message
De
09/02/2001 23:42:35
 
 
À
08/02/2001 14:54:43
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Re: EXISTS
Divers
Thread ID:
00473986
Message ID:
00474696
Vues:
20
Mike,

Which is more efficient? (runs faster?) I assume in the first case the subquery is run ONCE but in the second it is run once for each record in titles, but only getting one record.

>You can use both NOT IN and NOT EXIST to generate the same results. The following examples show this. You can run them in the Pubs sample database.
>
>
>SELECT *
>FROM titles
>WHERE title_id NOT IN (
>	SELECT title_id
>	FROM sales )
>
>SELECT *
>FROM titles
>WHERE NOT EXISTS (
>	SELECT *
>	FROM sales
>	WHERE sales.title_id = titles.title_id)
>
>
>I'm not sure why you're having problems. Are there NULLs in the vcRequestor or TolasKey columns maybe?
>
>-Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform