Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count Children in SQL Select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00015517
Message ID:
00015622
Vues:
36
>>
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform