Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Flag for a value in a list
Message
From
14/01/2000 17:03:50
Michael Dougherty
Progressive Business Publications
Malvern, Pennsylvania, United States
 
 
To
14/01/2000 10:57:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00318140
Message ID:
00318391
Views:
27
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform