Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need help with simple SELECT - SQL command
Message
De
08/02/2002 13:39:44
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00617474
Message ID:
00617577
Vues:
31
>
SELECT state FROM table2 ;
>  WHERE State NOT IN (SELECT state FROM table1)
>* or using correlated query
>SELECT state FROM table2 ;
>  WHERE NOT EXISTS (SELECT state FROM table1 WHERE state = table2.state )
>
>
While VFP might optimize a correlated subquery like yours, in generally, when you can write a readable query without a correlated subquery, it's a better choice. (To the best of my knowledge, any correlated EXISTS query can be rewritten as an IN query, but sometimes the result is pretty obscure.)

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform