View Full Version : Deleting duplicated keys from mysql, how?
03-19-2007, 07:09 PM
I have a mysql table which has duplicated content. I want to delete all duplicated content, except leave one row. any suggestions?
03-19-2007, 09:12 PM
for a mysql question post in the mysql forum I'd suggest.
But yes you can do this:
ALTER IGNORE TABLE
ADD droplater UNIQUE(column1, column3, column4)
and later drop the index or leave it in as necessary.
you have to include all the columns that you want unique, and that is unique across those columns. for instance I left out column2 so you could have two rows with same info in columns 1,2,3 or 1,2,4 but not 1,3,4
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.