﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / How to fetch duplicate records / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 23:23:13 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to fetch duplicate records</title><link>http://www.sqlservercentral.com/Forums/Topic1410438-1292-1.aspx</link><description>select &amp;lt;field list req'd&amp;gt;from &amp;lt;your table&amp;gt;where &amp;lt;field with dupes&amp;gt; in (select &amp;lt;field with dupes&amp;gt; from &amp;lt;your table&amp;gt; group by &amp;lt;field with dupes&amp;gt;having count(*) &amp;gt; 1)</description><pubDate>Wed, 23 Jan 2013 04:12:47 GMT</pubDate><dc:creator>lestatf4</dc:creator></item><item><title>RE: How to fetch duplicate records</title><link>http://www.sqlservercentral.com/Forums/Topic1410438-1292-1.aspx</link><description>Yes, or use GROUP BY and HAVING.  Sounds suspiciously like an interview or homework question to me.John</description><pubDate>Wed, 23 Jan 2013 03:59:40 GMT</pubDate><dc:creator>John Mitchell-245523</dc:creator></item><item><title>RE: How to fetch duplicate records</title><link>http://www.sqlservercentral.com/Forums/Topic1410438-1292-1.aspx</link><description>[code="sql"]select name from (select  name, row_number() over ( partition by name  order by name ) rnkfrom  EmEmployeesand) t where t.rnk &amp;gt; 1 [/code]</description><pubDate>Wed, 23 Jan 2013 03:49:11 GMT</pubDate><dc:creator>Bhuvnesh</dc:creator></item><item><title>RE: How to fetch duplicate records</title><link>http://www.sqlservercentral.com/Forums/Topic1410438-1292-1.aspx</link><description>[quote][b]girish.nehte-1109699 (1/23/2013)[/b][hr]Hi,I am using SQL Server 2010 with Visual Studio for my application. Now I have a table say "EmEmployeesand that have some 5000 records. This table has a column "Name" which is not a primary field. There is a possibility of more than one records having same name. Now I have to fetch all the records having duplicate names. What should be the efficient way to do this?Please let me know.Regards,Girish[/quote] to get the faster and possible correct help , always post table definition , sampled data plus expected output. see the link in my signature</description><pubDate>Wed, 23 Jan 2013 03:46:09 GMT</pubDate><dc:creator>Bhuvnesh</dc:creator></item><item><title>How to fetch duplicate records</title><link>http://www.sqlservercentral.com/Forums/Topic1410438-1292-1.aspx</link><description>Hi,I am using SQL Server 2010 with Visual Studio for my application. Now I have a table say "EmEmployeesand that have some 5000 records. This table has a column "Name" which is not a primary field. There is a possibility of more than one records having same name. Now I have to fetch all the records having duplicate names. What should be the efficient way to do this?Please let me know.Regards,Girish</description><pubDate>Wed, 23 Jan 2013 03:21:46 GMT</pubDate><dc:creator>girish.nehte-1109699</dc:creator></item></channel></rss>