sql

来源:互联网 发布:python readlines 编辑:程序博客网 时间:2024/06/11 15:16

select
nvl(o.opername,t.txnoprid) as 操作员,
(case when t.open_channel=’00’ then ‘客服’
when t.open_channel=’01’ then ‘驴妈妈’
when t.open_channel=’02’ then ‘同城网’ else ‘未知’ end) as 支付渠道,
(case when t.paymode=’00’ then ‘现金’
when t.paymode=’01’ then ‘互联网已支付’
when t.paymode=’02’ then ‘刷卡’
when t.paymode=’03’ then ‘微信支付’ else ‘未知’ end) AS 支付方式,
count(1) as 售卡笔数,
to_char(sum(t.cardpdpt)/100,’99999999990.00’) AS 售卡押金功能费
from t_dtl_carddtl t
left join t_bse_info_opr o on t.txnoprid=o.operid
where t.inntype = ‘2063’ and t.errcode=0 –and t.settdate >=’20150929’ and t.settdate <= ‘20150930’
group BY t.txnoprid,o.opername,open_channel,paymode

0 0
原创粉丝点击