Re: Finding duplicate rows in a table

From: Oddmund Johannessen <oddmund_at_delab.sintef.no>
Date: 13 Jul 94 11:46:09
Message-ID: <ODDMUND.94Jul13114609_at_delab.sintef.no>


In article <CsuKyI.8qy_at_bigtop.dr.att.com> jameson_at_coupler.drink-eid (131W10000-JamesonJ(DR2483)56) writes:

   There are several tables in our database that contain duplicate records. Isn't there    some simple SQL code to locate duplicate rows in a table? I would really appreciate    it if you could post a sample.

                           Thanks,

                           Jeremy Jameson


Try something like this:

select * from EXAMPLE a /* delete from EXAMPLE a */ where exists (
  select null from EXAMPLE b

  where a.TNAME=b.TNAME
    and a.TABTYPE=b.TABTYPE
    and a.rowid > b.rowid) ;


Oddmund.Johannessen_at_delab.sintef.no Received on Wed Jul 13 1994 - 11:46:09 CEST

Original text of this message