insert into select中使用序号
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
结果报错:
此处序号不许使用,修改成如下结构就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;