数据库去除重复数据

小标记一下,数据库大量重复数据去除

下面是一个根据重复的name  移除的

create table temp select max(id) as id  from table1 group by name ;//name分组  拿到最大id  保存到临时表

delete table1 where id not in(select id from temp);

以上仅供参考,其他的比葫芦画瓢

原文地址:https://www.cnblogs.com/bfyx/p/4638353.html