mysql 表中重复数据过滤

表结构:

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);

mysql 表中重复数据过滤

上一篇:初学Redis(2)——用Redis作为Mysql数据库的缓存


下一篇:(转)MySQL性能测试