insert into select中使用序號
insert into select序號
今天寫sql:insert into select中想使用序列:
Sql代碼
insert into R_POL_VIPO (id, SUMVIPONUM, STATSTICSDATE) select R_POL_VIPO_seq.Nextval, VIPONUM, sysdate from R_POL_VIPO
結(jié)果報(bào)錯(cuò):
此處序號不許使用,修改成如下結(jié)構(gòu)就ok啦...
Sql代碼
insert into R_POL_VIPO (id, SUMVIPONUM, STATSTICSDATE) select R_POL_VIPO_seq.Nextval, b.* from (select VIPONUM, sysdate from R_POL_VIPO) b;