去掉重复数据

表test003

select * from test003

其中有二条记录一模一样,怎么找出是哪个ID出现重复了呢?

方法一:

select id from test003
group by id
having count(*)>1

 方法二:

--1 oracle数据库怎么删除重复数据只留一个

Delete from TABLE1
where rowid
 not in (select min(rowid) from TABLE1 group by badge,name,location )
原文地址:https://www.cnblogs.com/lijy/p/4197359.html