MySQL Forums
Forum List  »  Newbie

Deleting Duplicate Rows
Posted by: Mathew Byrne
Date: July 11, 2005 10:48PM

Hi,

I'm having difficulties at the moment with a suburbs table. The table is as follows:

suburbs(id, name, state)

id is the PK and (name, state) should be a unique key. The problem is that we didn't realise the need for the unique key until now. What is easiest way to delete all records from the database which violate this contraint?

In other words, if I had 2 records with name='Wallan' state='VIC', what is the easiest way to only keep 1?

Options: ReplyQuote


Subject
Written By
Posted
Deleting Duplicate Rows
July 11, 2005 10:48PM


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.