Re: Duplicate Table Entries

  • From: Connor McDonald <hamcdc@xxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Sat, 16 Apr 2005 12:07:34 +0100 (BST)

something like

select *
from (
  select *,
      row_number() over ( partition by col1, col2, col3, col4 order by 
<whatever> ) as r
  from my_table 
)
where r > 1

show the rows that have a duplicated based on col1,2,3,4

htht
connor

--- Lex de Haan <lex.de.haan@xxxxxxxxxxxxxx> wrote:
> are these "3 or 4 columns" always the same columns, for all rows, or do
> you want to identify the rows that are "almost identical" in general?
> 
> in case you mean the former, that's relatively easy. the latter will take
> some more intelligence :-)
> 
> cheers,
> Lex.
> 
> > Good Day All,
> >
> > I have a table with more than 100 columns of data.  In some cases,
> > several rows may have duplicate data except for 3 or 4 columns.
> > Is there an easy way to find those rows?
> >
> > Thanks in advance for any assistance.
> >
> > Bill
> >
> > William Gaston
> > Systems Designer / Information Technology
> > USG Corporation
> > Chicago, Il 60606
> > (312) 606-3851
> > wgaston@xxxxxxx
> >
> > --
> > //www.freelists.org/webpage/oracle-l
> >
> 
> 
> --
> //www.freelists.org/webpage/oracle-l
> 

Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions"
Co-author: "Oracle Insight - Tales of the OakTable"

web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald@xxxxxxxxx

"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, 
and...he will sit in a boat and drink beer all day"

------------------------------------------------------------

Send instant messages to your online friends http://uk.messenger.yahoo.com 
--
//www.freelists.org/webpage/oracle-l

Other related posts: