34,588
社区成员
发帖
与我相关
我的任务
分享
Create procedures tongj
as
begin
select 班級,
sum(case when 性別='男' then 1 else 0 end) as'男生人數',
sum(case when 性別='女' then 1 else 0 end) as'女生人數',
sum(1) as '總人數'
from tb
group by 班級
end