Find duplicate data in different column in a table

G

Guest

Hi

I have a customer database and would like to merge anyone who has the same
phone number or mobile number.

The table is
First name Last name Phone Mobile Email
John Smith 123
Mary Smith 456 123

So I want to find these Mr&Mrs Smith because John phone number is the same
as Mary's mobile

Can you help
 
G

Guest

Try these two queries --
angeline_1 ---
SELECT angeline.Phone
FROM angeline INNER JOIN angeline AS angeline_1 ON angeline.Phone =
angeline_1.Mobile;

SELECT angeline.[First name], angeline.[Last name], angeline.Phone,
angeline.Mobile, angeline.Email
FROM angeline, angeline_1
WHERE (((angeline.Phone)=[angeline_1].[Phone])) OR
(((angeline.Mobile)=[angeline_1].[Phone]))
ORDER BY angeline_1.Phone;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top