【正文】
內(nèi)容反插回來)(4).適用于有大量重復記錄的情況(exception into 子句法):采用alter table 命令中的 exception into 子句也能確定出庫表中重復的記錄。ORACLE中刪除重復記錄平時工作中可能會遇見當試圖對庫表中的某一列或幾列創(chuàng)建唯一索引時,系統(tǒng)提示 ora01452 :不能創(chuàng)建唯一索引,發(fā)現(xiàn)重復記錄。 (清空cz表的數(shù)據(jù),但保留cz表的結構)sqlinsert into cz select * from test。 c1 c10 c20 1 2 dsf 2 3 che 3 4 dff 4 5 err 5 3 dar 6 1 wee 7 2 zxc7 rows selected.從結果里能看到重復記錄已刪除。sqldelete from cz a where (select max(rowid) from cz b where = and = and =)。經(jīng)查看表cz總共有16條記錄:sqlset pagesize 100sqlselect * from cz。具體步驟如下:sql?/rdbms/admin/table created.sqldesc exceptions name null? type row_id rowid owner varchar2(30) table_name varchar2(30) constraint varchar2(30)sqlalter