title: Fix duplicate entries in table
body: <p>I just found out that a table on my production server (which holds approx. 35K records) contains 588 duplicate entries in an INT(11) column which has AUTO_INCREMENT.
  The UNIQUE key is missing on that column so that's probably the cause.</p>
  
  <p>Any ideas on how to give all duplicate entries a unique ID and then adding the UNIQUE key to the column so this will never happen again?</p>
  
  <p>Table schema:</p>
  
  <pre><code>CREATE TABLE `items` (
   `item_ID` int(11) unsigned NOT NULL auto_increment,
   `u_ID` int(10) NOT NULL default '0',
   `user_ID` int(11) NOT NULL default '0',
   `p_ID` tinyint(4) NOT NULL default '0',
   `url` varchar(255) NOT NULL,
   `used` int(10) unsigned NOT NULL,
   `sort` tinyint(4) NOT NULL,
   `last_checked` int(11) NOT NULL,
   `unixtime` int(11) NOT NULL,
   `switched` int(11) NOT NULL,
   `active` tinyint(1) NOT NULL default '0',
   UNIQUE KEY `unique` (`p_ID`,`url`),
   KEY `index` (`u_ID`,`item_ID`,`sort`,`active`),
   KEY `index2` (`u_ID`,`switched`,`active`),
   KEY `item_ID` (`item_ID`),
   KEY `p_ID` (`p_ID`),
   KEY `u_ID` (`u_ID`)
  ) ENGINE=MyISAM AUTO_INCREMENT=42755 DEFAULT CHARSET=utf8
  </code></pre>