Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Flag for a value in a list
Message
De
14/01/2000 17:03:50
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvanie, États-Unis
 
 
À
14/01/2000 10:57:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00318140
Message ID:
00318391
Vues:
26
>select distinct rep, .t. as SA_flag from myTable ; where pub = "SA" ;union ;
select distinct rep, .f. as SA_flag from myTable ;
where rep not in (select distinct rep from myTable where pub="SA") ;order by 1

Assuming a significant size "myTable", how would that statement compare with:
Select distinct rep, .t. as SA_Flag from myTable where pub="SA";
union;
Select distinct rep, .f. as SA_Flag from myTable where NOT (pub="SA")

It seems the first statement would be querying the same set twice.

I thought there was an "in-line" way to get a unique value from a group, but i guess the two-step union will work (almost) as effectively.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform