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报错,因为不能更新用于子查询里面的表。
时间: 2024-10-06 13:50:52