I've have tried googling this, but with no luck. All the answers I could find was with different information across the columns. In this case I have the same information (phone number) in multiple columns.
I have a table with customers and their phone numbers. Each customer have up to three different phone numbers in three different columns (home, work and mobile phone). A mobile number can be used as a home number. Some customers have the same phone number as other customers because they are husband and wife or parent and child. This is not okay in this case.
Therefore I need to search for dublicates in both the mobile phone and the home phone column. (The work phone number is ignored here.)
Example table:
ID / Phone home / Phone mobile
1 / 12345678 / 98765432
2 / 12345678 / 22222222
3 / 23456789 / 33333333
4 / 33333333 / 87654321
In the above table I would need the query to return all four customers. ID 1 and ID 2 because they have the same home phone number and ID 3 and ID 4 because they have the same number (33333333) in the home and mobile column.
I need the customer ID's of the duplicates at least, but I would like to see the duplicate phone number as well.
Thank you!