报的错是acct_item_id_seq.NEXTVAL 这个SEQ不允许写在这里
有没有好的方法实现?

解决方案 »

  1.   

    insert into TABLE_DES(AA,BB) select acct_item_id_seq.NEXTVAL,id,sum(charge) from TABLE_SRC group by id;
    就这个语句,报的错是:ORA-02287: sequence number not allowed here
      

  2.   

    insert into TABLE_DES(AA,BB) select acct_item_id_seq.NEXTVAL,id,sum(charge) from TABLE_SRC group by id;
    -------------
    你的目标只有两个字段,你怎么插入三个字段?insert into TABLE_DES(newid,AA,BB)
    select acct_item_id_seq.NEXTVAL,id,cnt
    from (
     select id,sum(charge) as cnt from TABLE_SRC group by id
    );这样试试看。