--如果是SQL Server数据库,就用:select bemarry=case when grouping(bemarry)=1 then '合计' else case when bemarry='A' then '已婚' else '未婚' end end
,人数=count(*)
from mytable
group by bemarry with rollup
,人数=count(*)
from mytable
group by bemarry with rollup
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货