Posted By

lixonic on 08/26/10


Tagged

mysql remove duplicate from rows entries


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

roli000
seloh77
lixonic
ljayz


Remove duplicate entries / rows from mySQL


 / Published in: SQL
 

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

  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  

You need to login to post a comment.