Mysql 删除重复记录,只保留最小的一条
delete from `jb_postcontent` where id not in(select min(id) from (select * from `jb_postcontent`) as t group by t.id);
网上搜索的大部分都是如下这样
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报错,因为不能更新用于子查询里面的表。