1. 首页
  2. 云计算
  3. kubernetes
  4. 用SQL语句删除掉重复的记录

用SQL语句删除掉重复的记录

上传者: 2020-12-17 13:43:57上传 PDF文件 40.2KB 热度 22次
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录 delete from people where peopleId in (select peopleId from people group by peopleId having cou
用户评论