Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get first name for the same address
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00271361
Message ID:
00272284
Vues:
24
I can not come up with a direct query that will give the results you want. YOu are not really looking for duplicates, but you want different names from the same address.

The best I can suggest is to use the original query I suggested to get a list of all addresses that have more than 1 record. Scan through that result and do a SELECT DISTINCT FNAME WHERE ADDRESS = lcADDRESS. If you get more than 1 record returned, you have an address with more than 1 unique name.

>I am getting the following results:
>----------------------------------------
>"JOE" "GONZALES" "12820 OOMIAK CIR"
>"JOE" "GONZALEZ" "12820 OOMIAK CIR"
>"JOE" "WILLIAMS" "3351 E 68TH AVE"
>"JOE" "WILLIAMS JR" "3351 E 68TH AVE"
>"VERONICA" "DARRELL" "4922 CASTLE CT"
>"VERONICA" "ISLER" "4922 CASTLE CT"
>"JOE" "KOON" "GENERAL DELIVERY"
>"VERONICA" "KIERECK" "GENERAL DELIVERY"
>
>As you see only the last two records are the actual match. The first
>2 pairs are duplicate, the third One are two VERONICAs . If I get two more VERONICAs under the last address which is GENERAL DELIVERY this is still
>ok, or if it could be several more JOEs with several more VERONICAs under
>the same address. Since it could be an apartment house.
>
>To make long story short the first 6 records are not needed. I wonder
>if there is a direct query to provide the right results.
>
>Appreciate your input.
>
>Doron
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform