TA的每日心情 | 开心 2021-12-13 21:45 |
---|
签到天数: 15 天 [LV.4]偶尔看看III
|
/*创建序列*/
create sequence seq1
increment by 1 /*每次自增1*/
start with 1 /*从1开始自增*/
maxvalue 1000 /*最大值为1000*/
minvalue 1 /*最小值为1*/
nocycle /*不循环*/
/*从序列取值:CURRVAL 取当前值,NEXTVAL取下一个值*/
insert into departments(department_id,
department_name,location_id)
values (dept_deptid_seq.NEXTVAL,
'Support',2500);
select SEQ1.CURRVAL from dual; /*没有测试成功*/
/*修改序列*/
alter SEQUENCE dept_seq
INCREMENT BY 20
MAXVALUE 999999
NOCACHE NOCYCLE;
/*删除序列*/
drop sequence dept_seq;
java学习者论坛:http://www.javaxxz.com |
|