MySQL Forums
Forum List  »  Newbie

Deleting duplicating rows from the table except one
Posted by: Sergei
Date: June 08, 2005 02:17AM

Hi all!

I need to solve the follow problem:

The Standard problem "to delete from table duplicating line, except one".

For Oracle she will dare approximately so (the idle time variant):

delete from table t1
where exists (select 1 from table t2 where t1.id = t2.id and t1.rowid > t2.rowid)

For Interbase, unless mistaken, pass approximately such:

delete from table t1
where id in (select id from table group by id having count(*)>1)

As such do by MySQL?

P.S. The version of my MySQL is 4.1.

Options: ReplyQuote


Subject
Written By
Posted
Deleting duplicating rows from the table except one
June 08, 2005 02:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.