I have 2 tables:
FATHER:
id
nome
Child:
id
idpai
sexo_filho
I wanted to do a SELECT that sums up the amount of children man and women, that's the problem, I can only do with one of the sex:
SELECT pai.nome, count(distinct filho.id) as somahomem
FROM pai
LEFT JOIN filho ON pai.id = filho.idpai AND conta_filho.sexo = 'm'
How to do with both sexes? Have the value of the two?