今天爱分享给大家带来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,转载请注明出处。
