HEXAQ : A friendly question - answer site for IT professionals

How to find duplicate value in two different columns of a table?


1

How can find duplicate value stored in a table but in different columns ?

I have two columns named phone and alternetphone. The table contains following data

phone             alternet_phone

1234567890        9876543210

1597531235        1234567890

First row of phone and second row of alternetphone are duplicating in order to find out duplicate record.

Is there any query I can write to find out such duplicate records?

Â
asked
 


≡ Total 1 Answer

0
SELECT     alternatephone, COUNT(alternatephone) AS dup_count FROM         table_nameGROUP BY alternatephoneHAVING     (COUNT(alternatephone) > 1) 
Â
replied


Enter your reply here
Answer Preview:
Viewed: 1206 times
Asked on: 5/29/2013
Permalink
Topics in this question
  10
Search Question
Similler Questions