码迷,mamicode.com
首页 > 其他好文 > 详细

sequence

时间:2019-03-15 17:37:06      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:upd   创建   max   star   next   with   nbsp   sel   查询   

 

 

--删除 sequence

drop sequence SEQ_T_PROJECT_COMMENT 


-- 创建 Create sequence
create sequence SEQ_T_PROJECT_COMMENT
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 10;

update T_PROJECT_COMMENT set id=seq_id.nextval ;

 

--查询sequence 的值

 

SELECT SEQ_T_PROJECT_COMMENT.NEXTVAL AS DN_LOG_ID FROM DUAL;
select 序列名.Nextval from dual;--生成并获得下一个序列


create sequence seq_id start with 1000 increment by 1 ;

update t set id=seq_id.nextval ;

 

sequence

标签:upd   创建   max   star   next   with   nbsp   sel   查询   

原文地址:https://www.cnblogs.com/sweet22353/p/10538264.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!