General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Get first name for the same address
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only