序列

序列创建语法

create sequence 序列名称

[increment by 步长]

[start with 开始值]

[maxvalue 最大值]

[minvalue 最小值]

[cycle]

[cache 缓存大小]

select 序列名称.nextval from dual; 下一个序列的值

select 序列名称.currval from dual;当前序列的值

Oracle 12c以后自动序列

create table 表名称(

列名称 类型 generaed by default as identity(

[increment by 步长]

[start with 开始值]

[maxvalue 最大值]

[minvalue 最小值]

[cycle]

[cache 缓存大小]

),

列名称 类型

)

原文地址:https://www.cnblogs.com/zuoyoufengyuan/p/8547732.html