34,591
社区成员
发帖
与我相关
我的任务
分享
select zy as 专业,count(*)as 男
from XSB
where xb=1
group by zy
select zy as 专业,count(*)as 女
from XSB
where xb=0
group by zy
select zy as 专业,sum(case xb when 1 then 1 else 0 end) as 男, sum(case xb when 0 then 1 else 0 end) as 女
group by zy
select zy as 专业,count(*)as 男
from XSB
where xb=1
group by zy
union all
select zy as 专业,count(*)as 女
from XSB
where xb=0
group by zy