Solved

finding duplicates in 2 tables using MSSQL 2005

Posted on 2010-11-29
2
230 Views
Last Modified: 2012-05-10
How do is find duplicates from 2 "different" tables using mssql 2005?
Need to check on the address1 and address2 fields.
Database 1 is contacts
Database 2 is leads

thx bob
0
Comment
Question by:goldmineexpert
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 250 total points
Comment Utility
select * from contacts c
where exists (select * from leads l
  where l.address1 = c.address1 and c.address2 = l.address2)

And v.v. for the leads table to find duplicates in the other
0
 
LVL 1

Assisted Solution

by:_DJ
_DJ earned 250 total points
Comment Utility
SELECT address1, address2 FROM contacts
INTERSECT
SELECT address1, address2 FROM leads
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now