展开全部
select bg_severity,count(*) as row_count
from 表名 group by bg_severity
结果:
bg_severity row_count
1-低 xx
2-中 xx
1-高 xx
select sum(case when bg_severity = N'1-低' then 1 else 0 end) as [1-低],
sum(case when bg_severity = N'2-中' then 1 else 0 end) as [2-中],
sum(case when bg_severity = N'3-高' then 1 else 0 end) as [3-高]
from 表名
结果:
1-低 |2-中 |3-高
xx |xx | xx
from 表名 group by bg_severity
结果:
bg_severity row_count
1-低 xx
2-中 xx
1-高 xx
select sum(case when bg_severity = N'1-低' then 1 else 0 end) as [1-低],
sum(case when bg_severity = N'2-中' then 1 else 0 end) as [2-中],
sum(case when bg_severity = N'3-高' then 1 else 0 end) as [3-高]
from 表名
结果:
1-低 |2-中 |3-高
xx |xx | xx
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询