适用场景:除主键外其余信息均相同的数据
delete from 表
where 主键 in
(select 主键 from 表 a where (a.另一个字段名) in (select 另一个字段名 from 表 group by 另一个字段名 having count(*) > 1)
and rowid not in (select min(rowid) from 表 group by 另一个字段名 having count(*)>1));
适用场景:除主键外其余信息均相同的数据
delete from 表
where 主键 in
(select 主键 from 表 a where (a.另一个字段名) in (select 另一个字段名 from 表 group by 另一个字段名 having count(*) > 1)
and rowid not in (select min(rowid) from 表 group by 另一个字段名 having count(*)>1));