November 3rd, 2000, 06:01 AM
I want to delete duplicate rows within a table for creating an unique index after this.
How can I do this with the delete statement or something like this?
November 3rd, 2000, 08:45 AM
The best way to do this would be to add an auto incement column(id), then delete the records you want by referencing them by the id
November 6th, 2000, 08:53 AM
Thanks for the help! I have added an unique column in this table. But how can I select records with same value in one field and delete all duplicate rows (maybe something like 'not distinct') ?
November 6th, 2000, 10:16 PM
Just thought of this...the easiest way to do this would be to create a second table, with your auto_increment column and unique index. Then, select * from the first table and insert the data into the new table. Rows that are duplicates will be rejected by the new table due to the unique constraint.
November 7th, 2000, 10:25 AM
Yes, that should be working. Thanks again, John!