欢迎访问!
您的支持是我们不断前行的动力!

SQL通过唯一序号去除重复数据

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.序号;

赞(0) 打赏
转载请注明出处,未注明出处不得转载,蜘蛛侠 » SQL通过唯一序号去除重复数据
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

蜘蛛侠,您身边的爬虫专家!

觉得文章有用就打赏一下文章作者吧

支付宝扫一扫打赏

微信扫一扫打赏