我现在用的SQL如下:
    select sum(m.ZJE) ZJE,
       sum(m.XJ) XJ,
       sum(m.YZYB) YZYB,
       sum(m.HJYB) HJYB,
       sum(m.YZLX) YZLX,
       sum(m.YL) YL
  from (select sum(t.totalsum_mny) ZJE, 0 XJ, 0 YZYB, 0 HJYB, 0 YZLX, 0 YL
          from T_OPR_CHARGE t,
               (select t.chargeno_chr
                  from T_OPR_CHARGE t
                 where t.status_int = 1
                   and t.operdate_dat between
                       to_date('2009-11-7 0:00:00', 'yyyy-mm-dd hh24:mi:ss') and
                       to_date('2009-11-17 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) b
         where t.chargeno_chr = b.chargeno_chr
        union all
        select 0, sum((a.paysum_mny - a.refusum_mny)) XJ, 0, 0, 0, 0
          from T_OPR_PAYMENT a,
               (select t.chargeno_chr
                  from T_OPR_CHARGE t
                 where t.status_int = 1
                   and t.operdate_dat between
                       to_date('2009-11-7 0:00:00', 'yyyy-mm-dd hh24:mi:ss') and
                       to_date('2009-11-17 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) b
         where a.chargeno_vchr = b.chargeno_chr
           and a.paytype_int=0
        union all
        select 0, 0, sum(c.cyfeediarymedfee_dec) YZYB, 0, 0, 0
          from T_OPR_PAYMENT a,
               t_opr_charge_medicare c,
               (select t.chargeno_chr
                  from T_OPR_CHARGE t
                 where t.status_int = 1
                   and t.operdate_dat between
                       to_date('2009-11-7 0:00:00', 'yyyy-mm-dd hh24:mi:ss') and
                       to_date('2009-11-17 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) b
         where a.chargeno_vchr = c.chargeno_chr
           and a.paytype_int = 3
           and c.ybtype_vchr = '扬州'
           and c.wsinskind <> '离休'
           and c.chargeno_chr = b.chargeno_chr
        union all
        select 0, 0, 0, sum(c.cyfeediarymedfee_dec) HJYB, 0, 0
          from T_OPR_PAYMENT a,
               t_opr_charge_medicare c,
               (select t.chargeno_chr
                  from T_OPR_CHARGE t
                 where t.status_int = 1
                   and t.operdate_dat between
                       to_date('2009-11-7 0:00:00', 'yyyy-mm-dd hh24:mi:ss') and
                       to_date('2009-11-17 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) b
         where a.chargeno_vchr = c.chargeno_chr
           and a.paytype_int = 3
           and c.ybtype_vchr = '邗江'
           and c.wsinskind <> '离休'
           and c.chargeno_chr = b.chargeno_chr
        union all
        select 0, 0, 0, 0, sum(c.cyfeediarymedfee_dec) YZLX, 0
          from T_OPR_PAYMENT a,
               t_opr_charge_medicare c,
               (select t.chargeno_chr
                  from T_OPR_CHARGE t
                 where t.status_int = 1
                   and t.operdate_dat between
                       to_date('2009-11-7 0:00:00', 'yyyy-mm-dd hh24:mi:ss') and
                       to_date('2009-11-17 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) b
         where a.chargeno_vchr = c.chargeno_chr
           and a.paytype_int = 3
           and c.ybtype_vchr = '扬州'
           and c.wsinskind = '离休'
           and c.chargeno_chr = b.chargeno_chr
        union all
        select 0, 0, 0, 0, 0, sum((a.paysum_mny - a.refusum_mny)) YL 
          from T_OPR_PAYMENT a,
               (select t.chargeno_chr
                  from T_OPR_CHARGE t
                 where t.status_int = 1
                   and t.operdate_dat between
                       to_date('2009-11-7 0:00:00', 'yyyy-mm-dd hh24:mi:ss') and
                       to_date('2009-11-17 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) b
         where a.paytype_int = 1
           and a.chargeno_vchr = b.chargeno_chr) m在程序中我只需要传入 t表的 t.operdate_dat 值,我想优化这段sql ,请各位帮帮忙