I have a table that has some duplicate results. For example:
`person_url` `movie_url`
1 2
1 2
2 3
Would become –>
`person_url` `movie_url`
1 2
2 3
I know how to do it by creating a new table,
create table tmp_credits (select distinct * from name);
However, it is a pretty large table and I have a couple indexes on it which will need to be re-created. How would I do this transformation in place, that is, without creating a new table?
You can add a
UNIQUEindex over your table’s columns using theIGNOREkeyword:As stated in the manual:
This will also prevent duplicates from being added in the future.