删除重复数据

1.通过临时表的中介作用:

create table temp_table as select distinct * from table_name;

truncate table table_name;

insert into table_name select * from temp_table;

commit;

drop table temp_table;

 

2. 通过rowid的作用:

delete from table_name a where rowid <( select max(b.rowid) from table_name b where  a.id=b.id [and a.id2=b.id2........]);

commit;  采用 >min 也可以。

另外在Excel中的只选不重复的记录方法:数据---筛选---高级---选择不重复的记录。


你可能感兴趣的:(Excel)