时间:2021-07-01 10:21:17 帮助过:2人阅读
网上搜索的大部分都是如下这样
delete from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) and rowid not in (select min(rowid) from people group by peopleId having count(peopleId )>1)
结果你会发现,mysql报错,因为不能更新用于子查询里面的表。
Mysql 删除重复记录,只保留最小的一条
标签: