第1个回答 2015-01-05
create sequence seq_test
minvalue 1
maxvalue 21
start with 1
increment by 1
cache 20
cycle
order;
minvalue 1 / nominvalue:最小值为1
maxvalue 21 / nomaxvalue:最大值为21
start with 1:从1开始计数
increment by 1:每次增加1
cache 20 / nocache:缓存20个sequence值 / 不缓存
使用:
insert into t(id) values(seq_test.nextval);本回答被提问者采纳