We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    SELECT  wua.internalKey, wua.fullname, wua.email, wua.logincount, wua.lastlogin
    FROM cms_web_user_attributes wua
    INNER JOIN (
        SELECT email
        FROM cms_web_user_attributes
        GROUP BY email
        HAVING count(email) > 1
    ) dup ON wua.email = dup.email
    ORDER BY wua.email
    

    This gets me all the users with duplicate email addresses. The problem I'm having is to figure out where to put the join to bring in the username from cms_web_users. Can anybody help me out here?
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 33968
      • 863 Posts
      I haven't used Evo for a long time, but perhaps you can join on internalKey?
      SELECT  wua.internalKey, usr.username, wua.fullname, wua.email, wua.logincount, wua.lastlogin
      FROM cms_web_user_attributes wua
      INNER JOIN (
          SELECT email
          FROM cms_web_user_attributes
          GROUP BY email
          HAVING count(email) > 1
      ) dup ON wua.email = dup.email
      INNER JOIN cms_web_users usr ON wua.internalKey = usr.id
      ORDER BY wua.email
      
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Thank you! That did the job perfectly.

        Now to tweak the script that imports the .csv into the user tables to check duplicate emails as well as duplicate usernames!
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org