1)添加字段
alter table 表名 add id int;
2)递增功能
--先建一个序列:
create sequence 序列名
increment by 1     --种子数
start with 1         --开始值
maxvalue 999999999  --序列最大值
nocycle
cache 103)如果你表原来 不为空,则补充ID值
update 表名 set id=rownum 4)
以后输入数据都应该这样:
insert into table(id,mydate....) values(序列名.nextval,'date'.....);   --将自动增1--上面的办法是从你插入的

解决方案 »

  1.   

    自动加1字段建立?create table a(b int, cvarchar2(5));建一个序列create sequence a_seq increment by 1 start with 100;建一个触发器create or replace trigger t_abefore insert on afor each rowbeginselect s_a.nextval into :new.b from dual;end;
      

  2.   

    建立一个序列 Sequence.create sequence seq increment by 1 start with 999999
    insert into t values(seq.nextval)