Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Marking the duplicate records

34MCA2K2Jul 20 2015 — edited Jul 21 2015

Hi Oracle Gurus,

Good Morning/Afternoon/Evening!!

There are quite a few methods to identify duplicate records efficiently. e.g. row_number() and group by however all these methods highlight the duplicate record only. Which means if your table has data like

   

IDNameRoomDate
1ABC2037/20/2015
2FGH1099/20/2015
3HSF2028/20/2015
4REF2018/20/2015
5FGH1099/20/2015
6HSF2918/24/2015

And I want to find duplicates on basis of Name/Room/Date

Most queries will give me

Either

   

IDNameRoomDate
5FGH1099/20/2015

or

   

IDNameRoomDate
2FGH109

9/20/2015

They won't give me both the records unless I first do a group by (or Row_Number) in an inner query and then try to get both the rows in the outer query. I think that shouldn't be the way.

I need a report which brings out both the records only

   

IDNameRoomDate
2FGH1099/20/2015
5FGH1099/20/2015

Hope the question is clear.

Thanks in advance!!

This post has been answered by Frank Kulash on Jul 20 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2015
Added on Jul 20 2015
7 comments
1,680 views