日期:2014-05-17 浏览次数:20780 次
select ye from base where (km in ('1001','1002') and flag = 1) or (km in ('1001','1002') and flag = 1) ;
------解决方案--------------------
select ye from base where (km in ('1001','1002') and flag = 1) or (km in ('1003','1004') and flag = 2) ;
------解决方案--------------------
select case when ye='1001' or ye='1002' then 1 when ye='1003' or ye='1004' then 2 else null end flag from base
------解决方案--------------------
1、union 集合集
2、
select sum(currbal) from dm_user.fsd_lns_fyjye
where (substr(subctrlcode,1,4)='1301' and flag='3' )
or (flag='1' and subctrlcode in ('1382001','1382005') )
and etl_date=to_date('2011-03-31','yyyy-mm-dd')
and profitbrc='01900'