Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Thanked 1 Time in 1 Post

    find duplicate email address that show in column1 or column2

    I have a primary email and secondary email column and wish to find all duplicates that appear. It does not matter the order of the results, just to show the duplicate entries, so I can manually edit them.
    I have tried to figure this out myself and not getting very far. I have the following that finds the duplicates for each column separately but wish to merge the query in to one so it find across both fields.

    results needed are both entries along with clientid.

    SELECT a.clientid, a.email
    FROM `list` a
    SELECT email
    FROM `list`
    GROUP BY email
    HAVING COUNT( clientid ) > 1
    ) aa ON a.email=aa.email
    ORDER BY `a`.`email` ASC

    SELECT b.clientid, b.email2
    FROM `list` b
    SELECT email2
    FROM `list`
    GROUP BY email2
    HAVING COUNT( clientid ) > 1
    ) bb ON b.email2=bb.email2
    ORDER BY `b`.`email2` ASC
    Last edited by jasonpc1; Mar 6th, 2019 at 09:17 AM.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts