表中重复数据的处理
说明:tabname为有重复数据的表名,tabname_new为新建的表名
1. create table tabname_new();
2. alter table tabname_new add constraints primary key(唯一索引列) constraint table_cons;
3. start violation table for tabname_new;
4. set constraint table_cons filtering;
5. insert into tabname_new select * from tabname;
6. select count(*) from tabname_new (1)
select count(*) from tabname (2)
select count(*) from tabname_new_vio (3)
如果(1)+(3)=(2) 表示数据正确
7. stop violation table for tabname_new;
8. drop table tabname;
drop table tabname_new_vio;
9. rename table tabname_new to tabname;
10. update statistics high for table tabname;