You are here: Need help with finding duplicate records please « MsSQL Server « IT news, forums, messages
Need help with finding duplicate records please

Posted by theintrepidfox on 07/23/07 13:15

Dear Group

Please accept my apologies for this trivial question. I can't get it
to work.
What I'm trying to achieve is to find duplicate contact records. E.g.
There might be two records relating to the same individual. Being
enetered as Phil Baker and Philip Baker. For that purpose I do a
duplicate serach on the lastname and a comparison on the first two
characters of the firstname to get a list of potential duplicates.

Please fiond the script I tried below.

SELECT ContactID, Lastname, Firstname FROM Contacts
WHERE LEFT(Firstname,2) IN
(SELECT LEFT(Firstname,2) FROM Contacts GROUP BY HAVING COUNT(*)>1)
AND Lastname IN
(SELECT Lastname FROM Contacts List GROUP BY Lastname HAVING
COUNT(*)>1)
ORDER BY Lastname ASC

I'm grateful for any hints and suggestions.
Thank you very much for your time and efforts,

Martin

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация