Home » SQL & PL/SQL » SQL & PL/SQL » Duplicate Records
Duplicate Records [message #218363] Wed, 07 February 2007 19:42 Go to next message
Messages: 225
Registered: July 2005
Senior Member

I have executed below query and found list of duplicates,


col1 col2 col3 col4 col5
1U aa 12 13
1P aa 12 14 tt

I have recevied below result set

1P aa 12 14 tt

Actually i wanted below duplicate record

1U aa 12 13

SELECT * tmp
 where rowid IN ( select rid from (select rowid rid,
 row_number() over (partition by col2 order by col2) rn
                            from tmp)
                   where rn <> 1);

Re: Duplicate Records [message #218364 is a reply to message #218363] Wed, 07 February 2007 20:34 Go to previous message
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Try order by col1 instead of order by col2

Ross Leishman
Previous Topic: Performance issue on this query
Next Topic: execute stored procedure
Goto Forum:

Current Time: Thu Oct 27 10:28:51 CDT 2016

Total time taken to generate the page: 0.10738 seconds