It's easiest to explain by way of an example. Lets say I have a table with 3 columns - father, their offspring and their childs sex. The result table will list the fathers number of children and the split of males and females.
This is the table:
Father Child Sex
-----------------------
alpha name1 m
alpha name2 f
alpha name3 m
alpha name4 f
alpha name5 f
beta name6 m
beta name7 m
charlie name8 f
charlie name9 m
Desired result:
Father num m f
-----------------------
alpha 5 2 3
beta 2 2 0
charlie 2 1 1
num = number of children
m = male, f = female
When I use count it gives me the the total amount of children from all fathers and I'm not sure how to split the results into male and female. Any ideas?