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;