SQLITE:delete from [表名] where [去重字段] in (select [去重字段] from [表名] group by [去重字段] having count([去重字段])>1) and rowid not in (select min(rowid) from [表名] group by [去重字段] having count([去重字段])>1);
MYSQL:delete 表名 from 表名,(select min(序号) 序号,去重字段 from 表名 group by 去重字段 having count(*) > 1) t2 where 表名.去重字段=t2.去重字段 and 表名.序号>t2.序号;
评论前必须登录!
注册