Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Count Children in SQL Select
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00015517
Message ID:
00015622
Views:
32
>>
>>Select parent.* ;
>> from parent,child ;
>> where parent.locindex=child.locindex ;
>> group by child.locindex ;
>> having count(*)>1
>>
>>If you need in child data you can select into cursor and then join to child table without grouping.
>
>I do need child data and parent data, what I want is an
>SQL select statement that will out put for only those
>parents that have more than one child, and I want to see data for
>both parent and child.
>
>Thanks for your help thus far...I would like to get it down to
>one select statement.

Actually you have this statement. Second join can be incorporated into it easily but remember two simpler SQL-statements usually run faster than one complicated.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform