How can data that violates a uniqueness constraint be removed?
I have a table that I would like to add a uniqueness constraint for. Inside the table is data that violates that constraint, and I would like to remove it. I don't care at this point which data I lose, only that the final data is good.
My first attempts at this have been to use 'create table like' to copy the table, use alter table to add the unique key, and the copy the data from the old table to the new table.
Unfortunately the last step copies all the data and doesn't complain about the uniqueness.