嗨,我只需要简单的QUERY - MYSQL FOR MY DASHBOARD。使用线条图和区域图.. enter image description here
Citizentable
censusyeartable
预期产出:
我几乎无法弄清楚如何获得确切的价值..
CAN ANYBODY可以帮助我
答案 0 :(得分:0)
我认为您需要这样的查询:
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
问候。