<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to delete duplicate rows with SQL</title>
	<atom:link href="http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 09:56:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: veeramanink</title>
		<link>http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/#comment-18654</link>
		<dc:creator>veeramanink</dc:creator>
		<pubDate>Wed, 15 Sep 2010 06:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=241#comment-18654</guid>
		<description>try this also
--insert into staff_mas values(4,&#039;bala&#039;)

select * from staff_mas
//* Before Delete Duplicate records
-------------------
&#124;s_code &#124; S_name  &#124;
-------------------
&#124; 1	&#124; varathu &#124;
&#124; 1	&#124; varathu &#124;
&#124; 2	&#124; veera   &#124;
&#124; 2	&#124; veera   &#124;
&#124; 2	&#124; veera   &#124;
&#124; 3	&#124; suresh  &#124;
&#124; 3	&#124; suresh  &#124;
&#124; 4	&#124; bala    &#124;
&#124; 4	&#124; bala    &#124;
&#124; 4	&#124; bala    &#124;
-------------------
*//
--Delete Query Run Row by Row So we can set rowcount 1
set rowcount 1 
delete staff_mas from staff_mas s1 where (select count(S_code) from staff_mas s2 where s2.s_code=s1.s_code)&gt;1

while @@rowcount &gt; 0 
delete staff_mas from staff_mas s1 where (select count(s_code) from staff_mas s2 where s2.s_code=s1.s_code)&gt;1

--Now this time we can reset the rowcount value is 0 then only we get full result of the Query
set rowcount 0

select * from staff_mas
//* After Delete Duplicate records
-------------------
&#124; s_code&#124; S_name  &#124;
-------------------
&#124; 1	&#124; varathu &#124;
&#124; 2	&#124; veera   &#124;
&#124; 3	&#124; suresh  &#124;
&#124; 4	&#124; bala    &#124;
-------------------
*//</description>
		<content:encoded><![CDATA[<p>try this also<br />
&#8211;insert into staff_mas values(4,&#8217;bala&#8217;)</p>
<p>select * from staff_mas<br />
//* Before Delete Duplicate records<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
|s_code | S_name  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| 1	| varathu |<br />
| 1	| varathu |<br />
| 2	| veera   |<br />
| 2	| veera   |<br />
| 2	| veera   |<br />
| 3	| suresh  |<br />
| 3	| suresh  |<br />
| 4	| bala    |<br />
| 4	| bala    |<br />
| 4	| bala    |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
*//<br />
&#8211;Delete Query Run Row by Row So we can set rowcount 1<br />
set rowcount 1<br />
delete staff_mas from staff_mas s1 where (select count(S_code) from staff_mas s2 where s2.s_code=s1.s_code)&gt;1</p>
<p>while @@rowcount &gt; 0<br />
delete staff_mas from staff_mas s1 where (select count(s_code) from staff_mas s2 where s2.s_code=s1.s_code)&gt;1</p>
<p>&#8211;Now this time we can reset the rowcount value is 0 then only we get full result of the Query<br />
set rowcount 0</p>
<p>select * from staff_mas<br />
//* After Delete Duplicate records<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| s_code| S_name  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| 1	| varathu |<br />
| 2	| veera   |<br />
| 3	| suresh  |<br />
| 4	| bala    |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
*//</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/#comment-18347</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Fri, 21 May 2010 11:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=241#comment-18347</guid>
		<description>Perfect - technique 3 worked for me!  Thanks for the post!</description>
		<content:encoded><![CDATA[<p>Perfect &#8211; technique 3 worked for me!  Thanks for the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonez1</title>
		<link>http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/#comment-18155</link>
		<dc:creator>jonez1</dc:creator>
		<pubDate>Sun, 18 Apr 2010 19:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=241#comment-18155</guid>
		<description>Hi. I&#039;m adding my &quot;thanks&quot; to the &quot;thank_you row&quot;.</description>
		<content:encoded><![CDATA[<p>Hi. I&#8217;m adding my &#8220;thanks&#8221; to the &#8220;thank_you row&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timor</title>
		<link>http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/#comment-18026</link>
		<dc:creator>timor</dc:creator>
		<pubDate>Mon, 15 Mar 2010 13:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=241#comment-18026</guid>
		<description>Thank you so much as you have save my life, i was searching....searching...searching to find how to remove duplicate. you way the best. keep up the good work</description>
		<content:encoded><![CDATA[<p>Thank you so much as you have save my life, i was searching&#8230;.searching&#8230;searching to find how to remove duplicate. you way the best. keep up the good work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy Bellingan</title>
		<link>http://www.xaprb.com/blog/2006/10/11/how-to-delete-duplicate-rows-with-sql/#comment-17477</link>
		<dc:creator>Roy Bellingan</dc:creator>
		<pubDate>Thu, 24 Dec 2009 20:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=241#comment-17477</guid>
		<description>This article is very impressive, superb!</description>
		<content:encoded><![CDATA[<p>This article is very impressive, superb!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

