oracle一张表,不同的where条件count出来的结果,并列创建在一个视图里,sql怎么写?
1个回答
展开全部
create view vw_new as
select sum(case when fnumber = 100013 then 1 else 0 end) count_1,
sum(case when fnumber = 100012 then 1 else 0 end) count_2,
sum(case when fnumber = 100011 then 1 else 0 end) count_3 From table_c a
select sum(case when fnumber = 100013 then 1 else 0 end) count_1,
sum(case when fnumber = 100012 then 1 else 0 end) count_2,
sum(case when fnumber = 100011 then 1 else 0 end) count_3 From table_c a
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询