序列

序列创建语法

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 缓存大小]

),

列名称 类型

)

posted @ 2018-03-12 10:01  左右逢源  阅读(108)  评论(0编辑  收藏  举报