Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Finding duplicate rows by matching multiple fields
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 04/20/2011 :  19:18:41  Show Profile  Reply with Quote
Good day all,

My question pertains to a table similar to the one below. Consider an employee table with the following data (first row header) and no primary key:


Given such a table, what is the correct SQL syntax (SQL Server 2000) that would return the first three row (i.e. disregards first name, and returns rows with duplicate last name AND email AND telephone)?

Thank you to all in advance.

Posting Yak Master

153 Posts

Posted - 04/20/2011 :  19:42:02  Show Profile  Reply with Quote

select *
from employee a
where exists (select LastName, Email, Telephone
              from employee b
              where a.LastName = b.LastName and
                    a.Email = b.Email and
                    a.Telephone = b.Telephone
              group by LastName, Email, Telephone
              having count(*) > 1)

Go to Top of Page

Starting Member

2 Posts

Posted - 04/21/2011 :  10:30:59  Show Profile  Reply with Quote
Thank you. Worked like a charm.
Go to Top of Page

Starting Member

1 Posts

Posted - 10/09/2012 :  04:21:39  Show Profile  Reply with Quote
Initial obsrvation is under way so I woukd like to suggest u please wait for sometimw.

Muhammed Maqsood |Application Support Team Member (ASG)|TCS
Springboard BAM/EDW | EIP | AS&M |Service Infrastructure| BT Operate
Plot B1, Block EP & GP, Sector - V, Salt Lake Electronics Complex, Kolkata - 700091 INDIA
Office : +91 33 - 66366197 | Mobile : +91 90383 48889
Experience certainty. IT Services
Business Solutions
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000