Delete Dulicate Rows in MySQL


/ Published in: SQL
Save to your folder(s)

Where bad_table is the name of the table containing duplicate rows.


Copy this code and paste it in your HTML
  1. CREATE TEMPORARY TABLE bad_temp AS SELECT DISTINCT * FROM bad_table;
  2. DELETE FROM bad_table;
  3. INSERT INTO bad_table SELECT * FROM bad_temp;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.