Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
mysql [2008/09/03 18:54]
a
mysql [2008/09/26 19:15]
a
Line 20: Line 20:
  
 GRANT ALL PRIVILEGES ON *.* TO myuser@localhost IDENTIFIED BY 'password' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON *.* TO myuser@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
 +
 +
 +==== MySQL: removing duplicate rows from a table ====
 +
 +First create a temporary table containing the cleaned-up data:
 +
 +   CREATE TABLE without_duplicates_temp SELECT * FROM original_table GROUP BY columns, that, must, be, unique;
 +
 +and then just delete the original and rename the temporary table:
 +
 +   DROP TABLE original_table;
 +   RENAME TABLE without_duplicates_temp TO original_table;
  
  
mysql.txt ยท Last modified: 2012/10/15 11:58 by zagi
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready