Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get first name for the same address
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Get first name for the same address
Miscellaneous
Thread ID:
00271361
Message ID:
00271361
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform