Link to home
Start Free TrialLog in
Avatar of cpyatt05
cpyatt05Flag for United States of America

asked on

Count distinct parent and child records

I have a query which returns a individual records where a parent-child realtionship exists. I would like to count the distinct parent records and distinct child records. Each parent can have >1 child, but for some reason the number of parent records  = child records which is incorrect. Here is an example

Parent Record 001 + Child Record 001
Parent Record 001 + Child Record 002
Parent Record 001 + Child Record 003

The result I am looking for would be 1 Parent + 3 Child on a single row returned in my query. It should be fairly simple, but I am stumped.
Thanks in advance for your help.
Chad
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cpyatt05

ASKER

I was hoping to do all of this in one query, but your solution works fine. Thanks for your help!
I thought it might be simple. I guess I just couldn't see it. Thanks again.