1.序列的语法形式 create sequence 序列名 increment by n start with n maxvalue n | nomaxvalue minvalue n | nominvalue cycle | nocycle cache n | nocache 序列以(start with n)为第一个序列的值,序列各值之间的间隔为(increment by n),序列的最大值为(maxvalue n),序列的最小值为(minvalue n)cycle表示如果序列的值大于最大值
什么是序列?在mysql中有一个主键自动增长的id,例如:uid number primary key auto_increment;在oracle中序列就是类似于主键自动增长,两者功能是一样的,只是叫法不同而已. 在oracle中想要实现id自动增长只能用序列来实现.在oracle中,是将序列装入内存,可以提高访问效率. 1.)序列的创建 create sequence 序列名称 increment by n 每次增长多少 //系统默认值为1. start with n从几开始 //系统默认