方法1、删除重建
方法2、alter sequence 将increment by 的值设置为-...,然后select一次,再做一次
       alter sequence

解决方案 »

  1.   

    truncate table tbname和mssql里的一样
      

  2.   

    1.删除重建是比较简单的方法/
    2.有
      SQL> truncate table testc;  Table truncated.  SQL>
      

  3.   

    sorry,写错了
    truncate table tbname 把表截断
      

  4.   

    方法2、alter sequence 将increment by 的值设置为-...,然后select一次,再做一次
           alter sequence
    ------
    这个有点不明白,哪位大侠帮我写段代码吧,谢谢。
    create sequence seq_accountID
    minvalue 1
    maxvalue 99999
    increment by 1
    start with 1
    /
      

  5.   

    1,setval()
    2,试试不就知道了
      

  6.   

    1,setval()
    --
    小弟很菜,如果我有个序列名字是seq_accountID,如何不重建让值重新重1开始?
    有谁帮我写段代码吧,谢谢。
      

  7.   

    发送者 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
    ----------
             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;
    序列已更改。