<?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: Como selecionar registros duplicados em uma tabela SQL</title>
	<atom:link href="http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/</link>
	<description>Informações em 8 bits</description>
	<lastBuildDate>Sat, 19 May 2012 01:04:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Ricardo Pinguim</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-1184</link>
		<dc:creator>Ricardo Pinguim</dc:creator>
		<pubDate>Wed, 29 Jun 2011 18:51:20 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-1184</guid>
		<description>acabou de me salvar xDDDDDD</description>
		<content:encoded><![CDATA[<p>acabou de me salvar xDDDDDD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lourival Jr.</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-1175</link>
		<dc:creator>Lourival Jr.</dc:creator>
		<pubDate>Wed, 25 May 2011 21:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-1175</guid>
		<description>-- Vejam este script que fiz para resolver um problema na empresa que trabalho
-- Obter quantidade de registros repetidos em uma tabela Y
-- Este scritp vai mostrar os registros duplicatos e a quantidade dos mesmos
-- totalizando o total por periodo.
-- Com base neste, vocês podem adaptar para usas necessidades do dia-a-dia.

SELECT campo data,campo 2,COUNT(campo 2)
FROM tabela Y
WHERE campo 2 IN ( 
   SELECT DISTINCT(campo 2)
   FROM tabela Y
   WHERE campo 2 IN ( 
         SELECT campo 2 
         FROM tabela Y 
         WHERE campo data &gt;= TO_DATE(&#039;26/05/11&#039;) 
         AND campo data  1) 
   AND campo data &gt;= TO_DATE(&#039;26/05/11&#039;) 
   AND campo data &lt;= TO_DATE(&#039;27/05/11&#039;) )
GROUP BY ROLLUP(campo data,campo 2)
ORDER BY campo data,campo 2;</description>
		<content:encoded><![CDATA[<p>&#8211; Vejam este script que fiz para resolver um problema na empresa que trabalho<br />
&#8211; Obter quantidade de registros repetidos em uma tabela Y<br />
&#8211; Este scritp vai mostrar os registros duplicatos e a quantidade dos mesmos<br />
&#8211; totalizando o total por periodo.<br />
&#8211; Com base neste, vocês podem adaptar para usas necessidades do dia-a-dia.</p>
<p>SELECT campo data,campo 2,COUNT(campo 2)<br />
FROM tabela Y<br />
WHERE campo 2 IN (<br />
   SELECT DISTINCT(campo 2)<br />
   FROM tabela Y<br />
   WHERE campo 2 IN (<br />
         SELECT campo 2<br />
         FROM tabela Y<br />
         WHERE campo data &gt;= TO_DATE(&#8217;26/05/11&#8242;)<br />
         AND campo data  1)<br />
   AND campo data &gt;= TO_DATE(&#8217;26/05/11&#8242;)<br />
   AND campo data &lt;= TO_DATE(&#039;27/05/11&#039;) )<br />
GROUP BY ROLLUP(campo data,campo 2)<br />
ORDER BY campo data,campo 2;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diogo</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-891</link>
		<dc:creator>Diogo</dc:creator>
		<pubDate>Tue, 13 Jul 2010 13:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-891</guid>
		<description>Ajudou muito, dica valiosa!</description>
		<content:encoded><![CDATA[<p>Ajudou muito, dica valiosa!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edson Sguizzato</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-606</link>
		<dc:creator>Edson Sguizzato</dc:creator>
		<pubDate>Thu, 08 Oct 2009 17:54:23 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-606</guid>
		<description>Obrigado Vinicius.</description>
		<content:encoded><![CDATA[<p>Obrigado Vinicius.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinicius Oliveira</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-605</link>
		<dc:creator>Vinicius Oliveira</dc:creator>
		<pubDate>Thu, 08 Oct 2009 11:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-605</guid>
		<description>Olá!! criei uma software para selecionar registros duplicados em tabelas SQl, atualmente funciona para Oracle, MYSQL,Postgre. ai tá o link do projeto no sourceforge https://sourceforge.net/projects/locatorduplicat/files/


Vinicius Oliveira</description>
		<content:encoded><![CDATA[<p>Olá!! criei uma software para selecionar registros duplicados em tabelas SQl, atualmente funciona para Oracle, MYSQL,Postgre. ai tá o link do projeto no sourceforge <a href="https://sourceforge.net/projects/locatorduplicat/files/" rel="nofollow">https://sourceforge.net/projects/locatorduplicat/files/</a></p>
<p>Vinicius Oliveira</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kellsens Willamos</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-371</link>
		<dc:creator>Kellsens Willamos</dc:creator>
		<pubDate>Thu, 16 Apr 2009 10:44:06 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-371</guid>
		<description>Ótima dica, Mino</description>
		<content:encoded><![CDATA[<p>Ótima dica, Mino</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mino</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-370</link>
		<dc:creator>Mino</dc:creator>
		<pubDate>Wed, 15 Apr 2009 20:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-370</guid>
		<description>select campo, count(*) from tabela group by campo having count(*) &gt; 1</description>
		<content:encoded><![CDATA[<p>select campo, count(*) from tabela group by campo having count(*) &gt; 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kellsens Willamos</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-215</link>
		<dc:creator>Kellsens Willamos</dc:creator>
		<pubDate>Mon, 20 Oct 2008 12:59:04 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-215</guid>
		<description>Valeu pela dica, Thiago.</description>
		<content:encoded><![CDATA[<p>Valeu pela dica, Thiago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thiago</title>
		<link>http://umbyte.com/2008/05/como-selecionar-registros-duplicados-em-uma-tabela-sql/comment-page-1/#comment-214</link>
		<dc:creator>Thiago</dc:creator>
		<pubDate>Mon, 20 Oct 2008 12:29:28 +0000</pubDate>
		<guid isPermaLink="false">http://umbyte.com/?p=6#comment-214</guid>
		<description>Se o seu banco de dados tiver suporte a sub-selects:

SELECT 
         campo_que_repete, 
         campo1, 
         campo2, 
         campo3 
FROM
tabela tab1 
  WHERE (SELECT count(*)    
               FROM tabela tab2 
             WHERE tab2.campo_que_repete = tab1.campo_que_repete) &gt; 1


Note que os alias tab1 e tab2 se referem a mesma tabela</description>
		<content:encoded><![CDATA[<p>Se o seu banco de dados tiver suporte a sub-selects:</p>
<p>SELECT<br />
         campo_que_repete,<br />
         campo1,<br />
         campo2,<br />
         campo3<br />
FROM<br />
tabela tab1<br />
  WHERE (SELECT count(*)<br />
               FROM tabela tab2<br />
             WHERE tab2.campo_que_repete = tab1.campo_que_repete) &gt; 1</p>
<p>Note que os alias tab1 e tab2 se referem a mesma tabela</p>
]]></content:encoded>
	</item>
</channel>
</rss>

