Solved

finding duplicates in 2 tables using MSSQL 2005

Posted on 2010-11-29
2
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 250 total points
ID: 34235775
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
ID: 34236531
SELECT address1, address2 FROM contacts
INTERSECT
SELECT address1, address2 FROM leads
0

Featured Post

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

756 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