mysql 表中重复数据过滤

表结构:

 

 

 

 

 

 操作语句:

SET SQL_SAFE_UPDATES = 0;

eg1:delete from ybtest.student where id not in( select minId from ( select min(id) as minid from ybtest.student group by name,sex,subject,score ) as T ) ;
eg2:delete from ybtest.student where id in ( select *from ( select max(id) as maxid from ybtest.student group by name,sex,subject,score having count(*)>1) as a);

posted on   Frank-  阅读(1679)  评论(0编辑  收藏  举报

努力加载评论中...

导航

点击右上角即可分享
微信分享提示