今天爱分享给大家带来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://blog.itblood.com/190.html,转载请注明出处。

![遗产v0.13.0.0 AI版[PC+安卓/2.02G/更新]D’Legacy [v0.13.0.0] [真人SLG/汉化/沙盒]](/wp-content/uploads/replace/2025/10/31/9a71cd440a0ca6560d03df89bb836e2e.webp)