Search code examples
mysqlemail-validation

How to fix emails containing double dot in domain?


How do I update an email containing a double dot in its domain using raw mysql query?

So I have these emails having this format [email protected] and turn it to this [email protected]


Solution

  • replace should do the trick:

    UPDATE mytable
    SET    email = REPLACE(email, '..', '.')
    WHERE  email LIKE '%..%'