I have a table of contacts. The table contains a mobile_phone column as well as a home_phone column. I'd like to fetch all duplicate contacts where a duplicate is two contacts sharing a phone number. If contact A's mobile_phone matches contact B's home_phone, this is also a duplicate. Here is an example of three contacts that should match.
contact_id|mobile_phone|home_phone|other columns such as email.......|...
-------------------------------------------------------------------------
111 |9748777777 |1112312312|..................................|...
112 |1112312312 |null |..................................|...
113 |9748777777 |0001112222|..................................|...
Here is a query that finds duplicates, just not across fields.
select mobile_phone from contacts group by mobile_phone HAVING count(*) > 1 order by mobile_phone