如何让sequence重新从1开始?有没有像mssql里面的truncate table? 方法1、删除重建方法2、alter sequence 将increment by 的值设置为-...,然后select一次,再做一次 alter sequence 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 truncate table tbname和mssql里的一样 1.删除重建是比较简单的方法/2.有 SQL> truncate table testc; Table truncated. SQL> sorry,写错了truncate table tbname 把表截断 方法2、alter sequence 将increment by 的值设置为-...,然后select一次,再做一次 alter sequence------这个有点不明白,哪位大侠帮我写段代码吧,谢谢。create sequence seq_accountIDminvalue 1maxvalue 99999increment by 1start with 1/ 1,setval()2,试试不就知道了 1,setval()--小弟很菜,如果我有个序列名字是seq_accountID,如何不重建让值重新重1开始?有谁帮我写段代码吧,谢谢。 发送者 zmgowin 发送时间 2004-8-12 9:49:45 删除 回复 内容 09:47:32 SQL> create sequence seq_accountID increment by 1 start with 1;序列已创建。09:48:09 SQL>09:48:09 SQL> select seq_accountid.nextval from dual; NEXTVAL---------- 109:48:33 SQL> select seq_accountid.nextval from dual; NEXTVAL---------- 209:48:42 SQL> select seq_accountid.nextval from dual; NEXTVAL---------- 309:49:13 SQL> alter sequence seq_accountID increment by -3;序列已更改。09:49:36 SQL> select seq_accountid.nextval from dual; NEXTVAL---------- 009:49:48 SQL> alter sequence seq_accountID increment by 1;序列已更改。 oracle 多对多复杂查询问题 初学oracle。应该选什么书? 谁有oracle10g 的序列号 产品号 密码? 关于数据库启动的问题 如何处理数据表的数据合并问题!急急急! 字符字段中的空字符问题 如何建立dblink?如何使用? 安装求助 各位大虾,explain plan 怎么用?(初学者问题) 一个表里的索引一般建多少个比较好 使用PL/SQL导入数据库的方法!!!!!!! 众位大仙,拜托拜托!一个查询如何实现啊,太难了!
2.有
SQL> truncate table testc; Table truncated. SQL>
truncate table tbname 把表截断
alter sequence
------
这个有点不明白,哪位大侠帮我写段代码吧,谢谢。
create sequence seq_accountID
minvalue 1
maxvalue 99999
increment by 1
start with 1
/
2,试试不就知道了
--
小弟很菜,如果我有个序列名字是seq_accountID,如何不重建让值重新重1开始?
有谁帮我写段代码吧,谢谢。
内容 09:47:32 SQL> create sequence seq_accountID increment by 1 start with 1;
序列已创建。
09:48:09 SQL>
09:48:09 SQL> select seq_accountid.nextval from dual;
NEXTVAL
----------
1
09:48:33 SQL> select seq_accountid.nextval from dual;
NEXTVAL
----------
2
09:48:42 SQL> select seq_accountid.nextval from dual;
NEXTVAL
----------
3
09:49:13 SQL> alter sequence seq_accountID increment by -3;
序列已更改。
09:49:36 SQL> select seq_accountid.nextval from dual;
NEXTVAL
----------
0
09:49:48 SQL> alter sequence seq_accountID increment by 1;
序列已更改。