<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.6.5" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Adding a Unique Constraint on a Table with Duplicate Data</title>
	<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data</link>
	<description>News and views from Pythian DBAs</description>
	<pubDate>Thu,  4 Dec 2008 22:36:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Artículos destacados de Agosto &#124; cambrico.net</title>
		<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-272838</link>
		<dc:creator>Artículos destacados de Agosto &#124; cambrico.net</dc:creator>
		<pubDate>Sat, 06 Sep 2008 10:30:30 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-272838</guid>
		<description>[...] una constraint única cuando hay duplicados en una tabla, en el blog de The pythian group (en [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] una constraint única cuando hay duplicados en una tabla, en el blog de The pythian group (en [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Log Buffer #110: A Carnival of the Vanities for DBAs</title>
		<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-258297</link>
		<dc:creator>Log Buffer #110: A Carnival of the Vanities for DBAs</dc:creator>
		<pubDate>Fri, 15 Aug 2008 16:46:31 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-258297</guid>
		<description>[...] Here on the Pythian Group Blog, Nicklas Westerlund demonstrates adding a unique constraint on a table with duplicate data. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Here on the Pythian Group Blog, Nicklas Westerlund demonstrates adding a unique constraint on a table with duplicate data. [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicklas Westerlund</title>
		<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254568</link>
		<dc:creator>Nicklas Westerlund</dc:creator>
		<pubDate>Sat, 09 Aug 2008 15:30:10 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254568</guid>
		<description>Thanks all for your opinions. Is there any other subject you'd like me to blog about or explain in further detail?</description>
		<content:encoded><![CDATA[<p>Thanks all for your opinions. Is there any other subject you&#8217;d like me to blog about or explain in further detail?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: René Leonhardt</title>
		<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254478</link>
		<dc:creator>René Leonhardt</dc:creator>
		<pubDate>Sat, 09 Aug 2008 10:40:07 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254478</guid>
		<description>DELETE FROM t1
USING
post1164 AS t1
INNER JOIN post1164 AS t2
USING(b)
WHERE
t1.a &#60; t2.a;</description>
		<content:encoded><![CDATA[<p>DELETE FROM t1<br />
USING<br />
post1164 AS t1<br />
INNER JOIN post1164 AS t2<br />
USING(b)<br />
WHERE<br />
t1.a &lt; t2.a;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Noyes</title>
		<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254390</link>
		<dc:creator>Scott Noyes</dc:creator>
		<pubDate>Sat, 09 Aug 2008 03:43:41 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254390</guid>
		<description>DELETE FROM t1 
USING 
  post1164 AS t1 
  LEFT JOIN post1164 AS t2 ON 
    t1.b = t2.b 
    AND t1.a &#60; t2.a 
WHERE 
  t2.a IS NOT NULL;</description>
		<content:encoded><![CDATA[<p>DELETE FROM t1<br />
USING<br />
  post1164 AS t1<br />
  LEFT JOIN post1164 AS t2 ON<br />
    t1.b = t2.b<br />
    AND t1.a &lt; t2.a<br />
WHERE<br />
  t2.a IS NOT NULL;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: akira</title>
		<link>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254308</link>
		<dc:creator>akira</dc:creator>
		<pubDate>Fri, 08 Aug 2008 21:09:01 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/1164/adding-a-unique-constraint-on-a-table-with-duplicate-data#comment-254308</guid>
		<description>&lt;pre&gt;
CREATE TABLE tmp1164 LIKE post1164;
ALTER TABLE tmp1164 ADD UNIQUE KEY idx1(a);
INSERT IGNORE INTO tmp1164 SELECT * FROM post1164 ORDER BY a DESC 
RENAME TABLE post1164 TO old1164, tmp1164 TO post1164; SELECT * FROM post1164
&lt;/pre&gt;

</description>
		<content:encoded><![CDATA[<pre>
CREATE TABLE tmp1164 LIKE post1164;
ALTER TABLE tmp1164 ADD UNIQUE KEY idx1(a);
INSERT IGNORE INTO tmp1164 SELECT * FROM post1164 ORDER BY a DESC
RENAME TABLE post1164 TO old1164, tmp1164 TO post1164; SELECT * FROM post1164
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
