<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jan Ole Peek &#187; SQL Tips</title>
	<atom:link href="http://www.janolepeek.com/tag/sql-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://www.janolepeek.com</link>
	<description>Ramblings of an Internet Hermit</description>
	<lastBuildDate>Sun, 05 Feb 2012 04:26:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Finding and Deleting Duplicate Records</title>
		<link>http://www.janolepeek.com/finding-and-deleting-duplicate-records</link>
		<comments>http://www.janolepeek.com/finding-and-deleting-duplicate-records#comments</comments>
		<pubDate>Thu, 06 Oct 2005 06:33:11 +0000</pubDate>
		<dc:creator>jopeek</dc:creator>
				<category><![CDATA[Random Posts]]></category>
		<category><![CDATA[SQL Tips]]></category>

		<guid isPermaLink="false">http://www.janolepeek.com/finding-and-deleting-duplicate-records</guid>
		<description><![CDATA[INF: How to Remove Duplicate Rows From a Table SELECT col1, col2, count(*) FROM t1 GROUP BY col1, col2 HAVING count(*) &#62; 1 SELECT col1, col2, col3=count(*) INTO holdkey FROM t1 GROUP BY col1, col2 HAVING count(*) &#62; 1 DELETE t1 FROM t1, holdkey WHERE t1.col1 = holdkey.col1 AND t1.col2 = holdkey.col2 INSERT t1 SELECT ...]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:right;"><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.janolepeek.com/finding-and-deleting-duplicate-records" data-text="Finding and Deleting Duplicate Records" data-count="none" data-via="janolepeek" data-related="janolepeek"><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.janolepeek.com/finding-and-deleting-duplicate-records&amp;layout=standard&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><g:plusone size="medium" href="http://www.janolepeek.com/finding-and-deleting-duplicate-records"></g:plusone></div></div><p>    <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;139444">INF: How to Remove Duplicate Rows From a Table</a><br />
<code>SELECT col1, col2, count(*)<br />
FROM t1<br />
GROUP BY col1, col2<br />
HAVING count(*) &gt; 1</code></p>
<p><code>SELECT col1, col2, col3=count(*)<br />
INTO holdkey<br />
FROM t1<br />
GROUP BY col1, col2<br />
HAVING count(*) &gt; 1</code></p>
<p><code>DELETE t1<br />
FROM t1, holdkey<br />
WHERE t1.col1 = holdkey.col1<br />
AND t1.col2 = holdkey.col2</code></p>
<p><code>INSERT t1 SELECT * FROM holdkeySQL</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.janolepeek.com/finding-and-deleting-duplicate-records/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding and Deleting Duplicate Records</title>
		<link>http://www.janolepeek.com/finding-and-deleting-duplicate-records-2</link>
		<comments>http://www.janolepeek.com/finding-and-deleting-duplicate-records-2#comments</comments>
		<pubDate>Wed, 05 Oct 2005 16:33:11 +0000</pubDate>
		<dc:creator>jopeek</dc:creator>
				<category><![CDATA[SQL Tips]]></category>

		<guid isPermaLink="false">http://www.jpeek.net/wordpress/?p=66</guid>
		<description><![CDATA[INF: How to Remove Duplicate Rows From a Table SELECT col1, col2, count(*) FROM t1 GROUP BY col1, col2 HAVING count(*) > 1 SELECT col1, col2, col3=count(*) INTO holdkey FROM t1 GROUP BY col1, col2 HAVING count(*) > 1 DELETE t1 FROM t1, holdkey WHERE t1.col1 = holdkey.col1 AND t1.col2 = holdkey.col2 INSERT t1 SELECT ...]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:right;"><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.janolepeek.com/finding-and-deleting-duplicate-records-2" data-text="Finding and Deleting Duplicate Records" data-count="none" data-via="janolepeek" data-related="janolepeek"><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.janolepeek.com/finding-and-deleting-duplicate-records-2&amp;layout=standard&amp;show_faces=false&amp;width=50&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><g:plusone size="medium" href="http://www.janolepeek.com/finding-and-deleting-duplicate-records-2"></g:plusone></div></div><p><a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;139444">INF: How to Remove Duplicate Rows From a Table</a><br />
<code>SELECT col1, col2, count(*)<br />
FROM t1<br />
GROUP BY col1, col2<br />
HAVING count(*) > 1</code></p>
<p><code>SELECT col1, col2, col3=count(*)<br />
INTO holdkey<br />
FROM t1<br />
GROUP BY col1, col2<br />
HAVING count(*) > 1</code></p>
<p><code>DELETE t1<br />
FROM t1, holdkey<br />
WHERE t1.col1 = holdkey.col1<br />
AND t1.col2 = holdkey.col2</code></p>
<p><code>INSERT t1 SELECT * FROM holdkey<itag>SQL</itag></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.janolepeek.com/finding-and-deleting-duplicate-records-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

