<pre name="code" class="sql">SQL> select substr(xx.acct_no,1,5) agent_org, xx.vou_kind,sum( xx.trans_amt) trans_amt
from (
select * from dwf.F_EVT_SAVD_LIST
where trans_date >= to_date('2013-10-10', 'YYYY-MM-DD')
AND trans_date <= to_date('2014-03-31', 'YYYY-MM-DD')
) xx
where ( xx.vou_kind in ('3', '4')
or
( xx.vou_kind ='188' and xx.trans_code in ('100201','105301') )
)
and xx.dc_flag = '1'
group by substr
OR扩展
最新推荐文章于 2020-12-24 14:03:49 发布