<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to find duplicate rows with SQL</title>
	<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/</link>
	<description>Stay curious!</description>
	<pubDate>Fri, 08 Aug 2008 18:41:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Bebop</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-14352</link>
		<author>Bebop</author>
		<pubDate>Thu, 27 Mar 2008 11:03:16 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-14352</guid>
		<description>Does anyone want to help me?

I'm new to SQL, an absolute beginner. I can do what I want to do in basic, but can't access the databases that way!

Anyway, I want to isolate the dublicates across two tables.
The entries all have a unique ID, but I need a combination of the two to get what I need (All transactions, I need both ins and outs if you will!)  Whatever it is I've done, every transaction is repeating 16 times (Why 16? - I have no idea either!) So if anyone reading this knows how to do the above but across two tables, please let me know and I'll be your friend for life!</description>
		<content:encoded><![CDATA[<p>Does anyone want to help me?</p>
<p>I&#8217;m new to SQL, an absolute beginner. I can do what I want to do in basic, but can&#8217;t access the databases that way!</p>
<p>Anyway, I want to isolate the dublicates across two tables.<br />
The entries all have a unique ID, but I need a combination of the two to get what I need (All transactions, I need both ins and outs if you will!)  Whatever it is I&#8217;ve done, every transaction is repeating 16 times (Why 16? - I have no idea either!) So if anyone reading this knows how to do the above but across two tables, please let me know and I&#8217;ll be your friend for life!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donovan</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13684</link>
		<author>Donovan</author>
		<pubDate>Fri, 16 Nov 2007 00:14:39 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13684</guid>
		<description>A helpful way to get the index without too much trouble is to use MAX()...

select max(article_id) from articles group by headline HAVING count(*) &#62; 1</description>
		<content:encoded><![CDATA[<p>A helpful way to get the index without too much trouble is to use MAX()&#8230;</p>
<p>select max(article_id) from articles group by headline HAVING count(*) &gt; 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moon</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13561</link>
		<author>moon</author>
		<pubDate>Mon, 22 Oct 2007 06:51:17 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13561</guid>
		<description>Xaprb.............thanks 4 the reply.......

can u give an example ..........



thanks</description>
		<content:encoded><![CDATA[<p>Xaprb&#8230;&#8230;&#8230;&#8230;.thanks 4 the reply&#8230;&#8230;.</p>
<p>can u give an example &#8230;&#8230;&#8230;.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13542</link>
		<author>Xaprb</author>
		<pubDate>Thu, 18 Oct 2007 10:23:30 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13542</guid>
		<description>A WHERE clause should fix that.  Remember &lt;a href="http://www.xaprb.com/blog/2006/05/18/why-null-never-compares-false-to-anything-in-sql/" rel="nofollow"&gt;col = NULL is always false&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>A WHERE clause should fix that.  Remember <a href="http://www.xaprb.com/blog/2006/05/18/why-null-never-compares-false-to-anything-in-sql/" rel="nofollow">col = NULL is always false</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moon</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13541</link>
		<author>Moon</author>
		<pubDate>Thu, 18 Oct 2007 03:49:55 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13541</guid>
		<description>Thanks its a great article........ 

i used this query

" select b, c, count(*) from a_b_c group by b, c having count(1)    or count(1); "

it worked well

but my the problem is that its also showing the null values too as duplicates ..... IS there any way to avoide this.......?

thanks</description>
		<content:encoded><![CDATA[<p>Thanks its a great article&#8230;&#8230;.. </p>
<p>i used this query</p>
<p>&#8221; select b, c, count(*) from a_b_c group by b, c having count(1)    or count(1); &#8220;</p>
<p>it worked well</p>
<p>but my the problem is that its also showing the null values too as duplicates &#8230;.. IS there any way to avoide this&#8230;&#8230;.?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nancy</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13457</link>
		<author>Nancy</author>
		<pubDate>Fri, 05 Oct 2007 14:36:23 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13457</guid>
		<description>I have 1 table I need to find all duplicates from 3 columns (address1 city state) so I created a view and concatenated those 3 columns into 1 new called address3.  Each time I run a simple select distinct address3 query, I get a different result.  Is there a better way to find and delete these duplicates?  Thank you.</description>
		<content:encoded><![CDATA[<p>I have 1 table I need to find all duplicates from 3 columns (address1 city state) so I created a view and concatenated those 3 columns into 1 new called address3.  Each time I run a simple select distinct address3 query, I get a different result.  Is there a better way to find and delete these duplicates?  Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nan</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13420</link>
		<author>nan</author>
		<pubDate>Tue, 25 Sep 2007 06:16:00 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13420</guid>
		<description>I am still confused . My table is like this ....

IdNo    CustId    CustDesc
1        C1       Customer1
2        C1       Customer1
3        C1       Customer1
4        C2       Customer2
5        C2       Customer2
6        C2       Customer2
2        C2       Customer2
3        C3       CuStomer3
7        C3       Customer3

In the above example given I would like to see all the IdNos with different customers. My result will be IdNo's 2 and 3. Thanks</description>
		<content:encoded><![CDATA[<p>I am still confused . My table is like this &#8230;.</p>
<p>IdNo    CustId    CustDesc<br />
1        C1       Customer1<br />
2        C1       Customer1<br />
3        C1       Customer1<br />
4        C2       Customer2<br />
5        C2       Customer2<br />
6        C2       Customer2<br />
2        C2       Customer2<br />
3        C3       CuStomer3<br />
7        C3       Customer3</p>
<p>In the above example given I would like to see all the IdNos with different customers. My result will be IdNo&#8217;s 2 and 3. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smith</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13419</link>
		<author>smith</author>
		<pubDate>Mon, 24 Sep 2007 11:25:31 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13419</guid>
		<description>Hi all sql guru, please help me with the following:

Based from the data below, I need to get all the LAST transaction per compound keys(SPID   NPA   NXX   Line) and status != 'Delete'

Date		SPID	NPA	NXX	Line	Status	
9-23-2007       08088   204     987     9531	Delete
9-23-2007       08088   204     987     9532	Input
9-23-2007       08088   204     987     9533	Delete
9-23-2007       08088   204     987     9533	Add
9-23-2007       08089   204     977     2954	Add
9-23-2007       08089   204     977     2954	Delete
9-23-2007       08089   204     977     2954	Add
9-23-2007       08090   204     977     2956	Add
9-23-2007       08090   204     977     2956 	Delete


Target Result:
9-23-2007       08088   204     987     9532	Input
9-23-2007       08088   204     987     9533	Add
9-23-2007       08089   204     977     2954	Add</description>
		<content:encoded><![CDATA[<p>Hi all sql guru, please help me with the following:</p>
<p>Based from the data below, I need to get all the LAST transaction per compound keys(SPID   NPA   NXX   Line) and status != &#8216;Delete&#8217;</p>
<p>Date		SPID	NPA	NXX	Line	Status<br />
9-23-2007       08088   204     987     9531	Delete<br />
9-23-2007       08088   204     987     9532	Input<br />
9-23-2007       08088   204     987     9533	Delete<br />
9-23-2007       08088   204     987     9533	Add<br />
9-23-2007       08089   204     977     2954	Add<br />
9-23-2007       08089   204     977     2954	Delete<br />
9-23-2007       08089   204     977     2954	Add<br />
9-23-2007       08090   204     977     2956	Add<br />
9-23-2007       08090   204     977     2956 	Delete</p>
<p>Target Result:<br />
9-23-2007       08088   204     987     9532	Input<br />
9-23-2007       08088   204     987     9533	Add<br />
9-23-2007       08089   204     977     2954	Add</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13418</link>
		<author>Xaprb</author>
		<pubDate>Sat, 22 Sep 2007 11:50:28 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13418</guid>
		<description>Looks like you found the right place!  It's all on this page.</description>
		<content:encoded><![CDATA[<p>Looks like you found the right place!  It&#8217;s all on this page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nan</title>
		<link>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13417</link>
		<author>nan</author>
		<pubDate>Sat, 22 Sep 2007 05:50:11 +0000</pubDate>
		<guid>http://www.xaprb.com/blog/2006/10/09/how-to-find-duplicate-rows-with-sql/#comment-13417</guid>
		<description>Hi, I foound this is a very nice site for sql. I have a small query. In my table there are three fields CustNo, IdNo, Cust Desc. There can be any number IdNo for the CustNo. But the IdNo assigned to one customer can not be assigned to another. Now which is the best query to check if there are any IdNo common to more than one customer. Here CustNo can be repreated and IdNo Can be also be repeated any number of times in the table.. Thanks..</description>
		<content:encoded><![CDATA[<p>Hi, I foound this is a very nice site for sql. I have a small query. In my table there are three fields CustNo, IdNo, Cust Desc. There can be any number IdNo for the CustNo. But the IdNo assigned to one customer can not be assigned to another. Now which is the best query to check if there are any IdNo common to more than one customer. Here CustNo can be repreated and IdNo Can be also be repeated any number of times in the table.. Thanks..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
