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--上面的办法是从你插入的
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--上面的办法是从你插入的
insert into t values(seq.nextval)