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:
00271522
Vues:
35
Don't you need to see if there are multiple records with the same address first? Something like:
select cVot_Stree, count(*) as Kount from AK ;
   group by cVot_Stree having Kount > 1 ;
   order by 1 ;
   into cursor crsDoran noFilter
Then you couold scan through the cursor and issue the second query to get the names for each unique street address.

lcStreet = crsDoran.cVot_Stree
select First,LastN from AK where cVot_Stree == lcStreet


>Hi
>
>Need to get all records that consist of all couples that
>live under the same address
>
>The first query need to get records with the combination
>of the two first names. It could be let say 5 JOEs with
>1 VERONICA under same address.
>
>Appreciate your input.
>
>Doron
>
>SELECT ;
> AK.cVot_First ,;
> AK.cVot_LastN ,;
> AK.cVot_Stree ;
>FROM ;
> AK ;
>WHERE AK.cVot_First IN ("JOE","VERONICA") ;
>HAVING COUNT(*)>1 ;
>GROUP BY AK.cVot_Stree ;
>INTO CURSOR Doron ;
>ORDER BY AK.cVot_Stree NOFILTER
>
>IF _TALLY >0
> SELECT ;
> AK.cVot_First ,;
> AK.cVot_LastN ,;
> AK.cVot_Stree ;
> FROM ;
> AK ;
> JOIN Doron ;
> ON AK.cVot_Stree==Doron.cVot_Stree ;
> WHERE AK.cVot_First IN ("JOE","VERONICA") ;
> INTO CURSOR Ica ;
> ORDER BY AK.cVot_Stree
>ENDIF
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform