表atable(id,a) id需要自增 首先建立一个序列:
create sequence seq_atable minvalue 1 maxvalue 999999999999999999 start with 1 increment by 1 nocache

 

仅使用序列,需要在插入数据时,自增字段插入序列下一个值

如:insert into atable(id,a) values(seq_atable.nextval,'test');

相关文章: