COUNT MANY FIELDS IN ACCESS [closed]

I assume that you want to group on the NameId and ClassId fields, and that the Sex field in the result is not sex at all, but the number of persons. Something like this: select NameId, ClassId, count(*) as Sex, sum(Sex) as Male, count(*) – sum(Sex) as Female from TheTable group by NameId, ClassId Edit: … Read more