Oracle 删除重复数据只留一条
摘要:
Oracle 删除重复数据只留一条查询及删除重复记录的SQL语句1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断select * from 表 where Id in (select Id from 表 group byId having count(Id) > 1)2、删除表中多余的重复记录,重复记录是根据单个字段(Id)来判断,只留有rowid最小的记录DELETE from 表 WHERE (id) IN ( SELECT id FROM 表 GROUP BY id HAVING COUNT(id) > 1) AND ROWID NOT IN (SELECT 阅读全文
posted @ 2014-02-08 10:06 Jason_liu 阅读(533) 评论(0) 推荐(0) 编辑