http://expert.csdn.net/Expert/topic/1418/1418633.xml?temp=.8717157

解决方案 »

  1.   

    建立一个最小为1,最大为999999999的一个序列号会自动循环的序列create sequence 序列名 
    increment by 1 
    start with 1 
    maxvalue 999999999 
    cycle;当向表中插入数据时,SQL语句写法如下:SQL> insert into 表名 values(序列名.nextval,列1值,列2值);
      

  2.   

    http://expert.csdn.net/Expert/topic/1470/1470941.xml?temp=.4081079
    http://expert.csdn.net/Expert/topic/1465/1465844.xml?temp=3.927249E-02
    http://expert.csdn.net/Expert/topic/1436/1436331.xml?temp=.5476343讲的详细死了,看看~!:)
      

  3.   

    1、请先建立序列:
    create sequence temp
    minvalue 1
    maxvalue 999999
    start with 1
    increment by 1
    cache 100
    order;
    2、建测试用的表:
    create table temp (aa number,bb number);
    3、在表中插入数据:
    insert into temp values (v_temp.nextval,1);
    4、验证:
    SQL> select * from temp;        AA         BB
    ---------- ----------
             1          1