Return to Snippet

Revision: 41260
at February 15, 2011 02:39 by thepiglovesyou


Initial Code
	$mdb2->exec('CREATE TABLE temp_table as SELECT * FROM hatebu_hotentries GROUP BY link;');
	$mdb2->exec('DROP TABLE hatebu_hotentries;');
	$mdb2->exec('ALTER TABLE temp_table RENAME TO hatebu_hotentries;');
	$mdb2->exec('ALTER TABLE hatebu_hotentries ADD PRIMARY KEY(id);');
	$mdb2->exec('ALTER TABLE hatebu_hotentries ADD INDEX ( id );');
	$mdb2->exec('ALTER TABLE hatebu_hotentries CHANGE id id INT NOT NULL AUTO_INCREMENT;');

Initial URL


Initial Description


Initial Title
MySQL: remove duplicated records from table

Initial Tags


Initial Language
PHP