删除mysql中重复的数据记录

1、删除数据库 secondary.reg 中重复的数据

从id大的开始删除

#  删除表中多余的重复记录,
SET SQL_SAFE_UPDATES = 0;
delete from secondary.reg where regId not in (
    select r.min_id from 
        (select min(regId) as min_id from secondary.reg group by region_name) as r
);
SET SQL_SAFE_UPDATES = 1;

 

删除mysql中重复的数据记录

上一篇:【开源】.net微服务开发引擎Anno开源啦


下一篇:oracle表空间的理解