Re: Deleting duplicate rows

From: Steve Kinder <Steve_at_highview.demon.co.uk>
Date: 1995/11/20
Message-ID: <816898940snz_at_highview.demon.co.uk>#1/1


How about

If all rows duplicated :

delete from table where rowid in
(select max(rowid)

 from table
 group by primary key)

If not

delete from table where rowid in
(select max(rowid)

 from table a, table b
 where a.primary_key=b.primary_key
   and a.rowid != b.rowid)

or

delete from table where rowid in
(select max(rowid)

 from table a,table b
where a.primary_key=b.primary_key
group by primary_key) Received on Mon Nov 20 1995 - 00:00:00 CET

Original text of this message