首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

一条话语,删除mysql表的重复数据

2012-09-24 
一条语句,删除mysql表的重复数据在网上看到的,觉得有必要记录下。?delete students as a from students as

一条语句,删除mysql表的重复数据

在网上看到的,觉得有必要记录下。

?

delete students as a from students as a,(select * from students group by name having count(1)>1) as bwhere a.name=b.name and a.id > b.id;

?

达到了效果,就不知道效率如何。如果有更加好的方法,请赐教,不胜感激!

热点排行