日期:2014-05-16 浏览次数:20456 次
create table USERCOMPANYINFO_tmp as ( select * from USERCOMPANYINFO where rowid not in (SELECT A.ROWID FROM USERCOMPANYINFO A,(SELECT MAX(A.ROWID) RROWID,COMPANY FROM USERCOMPANYINFO A GROUP BY A.COMPANY HAVING COUNT(*) > 3) B WHERE A.COMPANY = B.COMPANY AND A.ROWID <> B.RROWID))
ORA-02266: unique/primary keys in table referenced by enabled foreign keys ORA-02266: 表中的唯一/主键被启用的外部关键字引用
alter table USERCOMPANYINFO disable primary key cascade; //清除外部引用 3 truncate table USERCOMPANYINFO;//清空数据 4 insert into USERCOMPANYINFO select * from USERCOMPANYINFO_tmp; //蒋临时表中的数据倒入目标数据表 5 alter table USERCOMPANYINFO enable primary key; //给目标数据表添加主键约束