MySQL Forums
Forum List  »  Newbie

Re: Create a unique index on column with duplicate records in order to restrict more duplications
Posted by: Peter Brawley
Date: September 21, 2016 12:15AM

One solution: create an empty but otherwise identical table, add the desired unique key, then INSERT IGNORE from the existing table. Dupe rows will be, um, ignored.

Options: ReplyQuote


Subject
Written By
Posted
Re: Create a unique index on column with duplicate records in order to restrict more duplications
September 21, 2016 12:15AM


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.