I think you need a query like this:
select
censusyear,
sum(case CitycenGender when 'Male' then 1 else 0 end) as 'Total Male',
sum(case CitycenGender when 'Female' then 1 else 0 end) as 'Total Male'
from CitycenTable
inner join CensusYearTable on CityCensusYear = CensusYearID
Regards.
2
solved SELECT COUNT TROUBLE IN QUERY [closed]