I am using the following query to select emails that are duplicates:
SELECT email
FROM contacts
WHERE active = 1
GROUP BY email
HAVING ( COUNT(email) > 1)
In the case above, if two users have the same email, that query will show them. However, there is another email field named email2, what can I do so that I compare the count among many email fields? (So, for example, if a user has email equal to email2 of another user, they will be considered duplicates)
Thank you!
P.S : my syntax could be wrong, but the idea should be something like this.