select
FullName=case when GROUPING(OfficeName)=0 then '' else FullName end,
OfficeName=case when GROUPING(OfficeName)=0 then OfficeName else '' end,
sum(AppCount) as SumCount
from V_officeInfo
where AppMonth=11 and Appyear=2010 and DepartID=1048
group by FullName,OfficeName with rollup
having GROUPING(FullName)=0
数据SQl分类汇总方法
最新推荐文章于 2024-02-29 19:11:30 发布