Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL: Distinct, Group By, or Exists?
Message
De
05/06/2003 10:09:57
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00796420
Message ID:
00796692
Vues:
13
>I would do it in one of two ways (in the order of my personal preferences)
>
SELECT PrimaryKey, DataItem ;
>  FROM TableA ;
>  WHERE PrimaryKey IN ( SELECT PrimaryKey FROM TableB WHERE Condition = .T.)
>*
>SELECT PrimaryKey, DataItem ;
>  FROM TableA ta ;
>  WHERE EXISTS ( SELECT * FROM TableB tb ;
>        WHERE ta.PrimaryKey = tb.PrimaryKey AND tb.Condition = .T.)
>
Would either of these or the options in the other thread work if TableB were a pre-existing view instead of a SELECT?

> You may want to take a look at recent discussion which one is faster. ?
> Re: How to use select... where EXISTS ... ? Thread #793069.

Still reading and digesting it. Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform