现在的位置: 首页 > 综合 > 正文

为有数据的表加入id主健的方法

2014年03月28日 ⁄ 综合 ⁄ 共 252字 ⁄ 字号 评论关闭

--1,======加入id值的方法============================
--add colnmu
alter table UM_MTSMS_SUM
add P_ID number(10);
--update id
begin
update UM_MTSMS_SUM set p_id=UM_MTSMS_SUM_sseq.NEXTVAL where p_id is null;
end;
--praimry
alter table UM_MTSMS_SUM
add constraint PK_UMS_S primary key(P_ID);

抱歉!评论已关闭.