求余额
SELECT ph, sum(slye) from
(
select ph,decode(SSSL,null,0,SSSL)SLYE from BB_MJ_KCRKD2_TB where to_char(ywrq,'yyyymm')<'201308' and instr(djzt,'审核')>0
UNION ALL
SELECT ph,decode(SFSL,null,0,-SFSL)SLYE
FROM BB_MJ_KCCKD2_TB where to_char(ywrq,'yyyymm')<'201308' and instr(djzt,'审核')>0 )T group by ph having sum(slye)!=0