还是用序列和触发器。参考:
http://expert.csdn.net/Expert/topic/1833/1833942.xml?temp=.869137
http://expert.csdn.net/Expert/topic/1636/1636810.xml?temp=6.928653E-02

解决方案 »

  1.   

    select rownum, 字段1,字段2,字段3 from table;
      

  2.   

    select rownum 编号,... from table;
      

  3.   

    create sequence yourseq 
    start with 1
    increment by 1
    maxvalue 99999;create or replace trigger yourtrigger
    before insert on tables
    for each row
    begin
    select yourseq .nextval into :new.ID from dual;
    end;以后插入时编号就会变成你想要得了序列 哪怕你指定了编号的数值 
      

  4.   

    ““编号”并不是表里的字段”,那就用ROWNUM了!