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

I have executed below query and found list of duplicates,

example

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);



Thanks
Re: Duplicate Records [message #218364 is a reply to message #218363] Wed, 07 February 2007 20:34 Go to previous message
rleishman
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 Dec 08 00:33:21 CST 2016

Total time taken to generate the page: 0.13641 seconds