zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

数据库去除重复数据

数据库数据 重复 去除
2023-09-14 09:07:53 时间

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

 

下面是一个根据重复的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);

 

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