Re: Remove Duplicate Rows without a Primary Key

From: nobody <nobody_at_nowhere.com>
Date: Mon, 27 Oct 2003 16:27:31 GMT
Message-ID: <THbnb.91911$h61.37794_at_news01.bloor.is.net.cable.rogers.com>


delete from foo x
where x.rowid <> (
  select min(rowid) from foo y
  where y.field1||y.field2 etc = x.field1||x.field2 etc

"Damien Cobbs" <damien.cobbs_at_gd-ais.com> wrote in message news:4c413633.0310270818.a8b0f9e_at_posting.google.com...
> Is there a way to remove duplicate rows from a table that does not
> have a primary key leaving one copy of the row without comparing each
> column to each other as suggested by the code example below:
>
> delete from foo x
> where x.rowid <> (
> select min(rowid) from foo y
> where y.primary key = x.primary key
> )
>
> Any ideas?
Received on Mon Oct 27 2003 - 17:27:31 CET

Original text of this message