Oracle数据库-序列【详细讲解】

今天爱分享给大家带来Oracle数据库-序列【详细讲解】,希望能够帮助到各位。

一、含义

序列是Oracle数据库中特有的,使用序列可以生成类似于 auto_increment 这种ID自动增长 1,2,3,4,5… 的效果

二、语法

create sequence 序列名称
start with 从几开始
increment by 每次增长多少
[maxvalue 最大值] | nomaxvalue
[minvalue 最小值] | nominvalue
cycle | nocycle --是否自动循环
[cache 缓存数量] | nocache;

三、演示

--创建序列
create sequence auto_increment_seq
start with 1
increment by 1
nomaxvalue
minvalue 1
nocycle
cache 10000;

--调用序列
select auto_increment_seq.nextval from dual;
select auto_increment_seq.currval from dual;
原文链接:https://itblood.website/190.html,转载请注明出处。
0
受孕吧!爆乳天国天使宝贝2~王都攻略篇~挂载AI汉化版+存档[新作][2.4G] [RPG/汉化/动态/CV]
受孕吧!爆乳天国天使宝贝2~王都攻略篇~挂载AI汉化版+存档[新作][2.4G] [RPG/汉化/动态/CV]
9分钟前 有人购买 去瞅瞅看

站点公告

显示验证码
没有账号?注册  忘记密码?