sql 语句

统计sql 语句 

 

select e.*,
round(( decode(e.bjzs,0,0,bjzs/e.zs))*100,2) || '%'  as bjl ,
round(( decode(e.bjcq,0,0,bjcq/e.zs))*100,2) || '%'  as bjcql,
round(( decode(e.zbcq,0,0,zbcq/e.zs))*100,2) || '%'  as zbcql,
round(( decode(e.gqcq,0,0,gqcq/e.zs))*100,2) || '%'  as gqcql  from (
select blks,ywlx,
count(*) as zs, 
count( case when t.lczt in ('1') then '1' end ) zbzs,  
count( case when t.lczt in ('1') and t.sxzt in ('1') then '1' end ) zbzc, 
count( case when t.lczt in ('1') and t.sxzt in ('3') then '1' end ) zbcq, 
count( case when t.lczt  in ('2') then '2' end ) bjzs ,
count( case when t.lczt in ('2') and t.sxzt in ('1') then '1' end ) bjzc, 
count( case when t.lczt in ('2') and t.sxzt in ('3') then '1' end ) bjcq, 
count( case when  t.rwzt in ('13') then '13' end ) as gqzs ,
count( case when t.lczt in ('13') and t.sxzt in ('1') then '1' end ) as gqzc, 
count( case when t.lczt in ('13') and t.sxzt in ('3') then '1' end ) as gqcq 
 from up_hzjg_accept_jt01 t {} group by ywlx,blks) e

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值