insert into T_CLEAR_FEEORDER (id,merno,Tranamt,Trannum,FEETYPE)select seq_clear_id.nextval,
       a.MERNO,
       a.TRANSFEEsum,
       a.cnt,
       SUBSTR(c.ACC_DATE, 0, 6),
       '0',
       b.RESERVACCTID,
       d.merstlbook
  from (SELECT MERNO,
               CAPCHANNELNO,
               NVL(sum(TRANSFEE), '0.00') TRANSFEEsum,
               count(*) cnt
          from T_CLEAR_TRANSORDER
        --where transdate like :acc_date and feesubtype = '02'
         group by (merno, CAPCHANNELNO)) a,
       "View_T_PAY_FUNDCHN_INFO" b,
       t_daily_info c,
       T_CLEAR_MERCLEAR_BOOK d
 where a.CAPCHANNELNO = b.FUNDCHNCODE
   and a.MERNO = d.merno;这条语句不太懂,请帮忙看看

解决方案 »

  1.   


    --取序列中的值
    seq_clear_id.nextval
    --一个子查询
    (SELECT MERNO,
      CAPCHANNELNO,
      NVL(sum(TRANSFEE), '0.00') TRANSFEEsum,
      count(*) cnt
      from T_CLEAR_TRANSORDER
      --where transdate like :acc_date and feesubtype = '02'
      group by (merno, CAPCHANNELNO)) a,
    --一个联合查询
     "View_T_PAY_FUNDCHN_INFO" b,
      t_daily_info c,
      T_CLEAR_MERCLEAR_BOOK d
    --联合查询的关联条件,c表的关联条件为何不加,最好加入
    where a.CAPCHANNELNO = b.FUNDCHNCODE
      and a.MERNO = d.merno;
      

  2.   

    C和D 关联条件都木有楼上解释 up+++
      

  3.   

    insert的表指定5个字段,select指定8个字段,不报错吗?..
      

  4.   

    insert表的5个字段,select表指定8个字段,不报错?