用sequence啊create sequence sequence_modify_record minvalue 1 maxvalue 99999999999999999999 start with 1 increment by 1 cache 20 / 使用: select sequence_modify_record.nextval into v_num from dual;
insert into temptab(col1,col2,col3) select a.col1,b.col2,c.col3 from table1 a,table2 b,table3 c where a.id=b.id and b.id=c.id; 这个上面不是三列吗,如果我增加一个自动增加的序列号, insert into temptab(sequence_modify_record.nextval,col1,col2,col3) select a.col1,b.col2,c.col3 from table1 a,table2 b,table3 c where a.id=b.id and b.id=c.id; 是不是可以这样写,就是我在临时表中建了四个字段,三个字段是从别的表里查询出来的,另外一个是我自动增加的序列号?
minvalue 1
maxvalue 99999999999999999999
start with 1
increment by 1
cache 20
/
使用:
select sequence_modify_record.nextval into v_num from dual;
insert into temptab(sequence_modify_record.nextval,col1,col2,col3) select a.col1,b.col2,c.col3 from table1 a,table2 b,table3 c where a.id=b.id and b.id=c.id;
是不是可以这样写,就是我在临时表中建了四个字段,三个字段是从别的表里查询出来的,另外一个是我自动增加的序列号?