Remove duplicate entries / rows from mySQL


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

This is the quick method and painless way to Remove duplicate entries from MySQL


Copy this code and paste it in your HTML
  1. CREATE TABLE new_table AS
  2. SELECT * FROM old_table WHERE 1 GROUP BY [COLUMN TO remove duplicates BY];
  3.  
  4.  
  5. DROP TABLE old_table;
  6.  
  7.  
  8.  
  9. RENAME TABLE new_table TO old_table;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.