Mysql-how to update the "domain.com" in "[email protected]"

Posted by w00t on Stack Overflow See other posts from Stack Overflow or by w00t
Published on 2010-05-26T14:29:32Z Indexed on 2010/05/26 14:31 UTC
Read the original article Hit count: 335

Filed under:
|
|
|

Hi there,

In my database I have a lot of users who've misspelled their e-mail address. This in turn causes my postfix to bounce a lot of mails when sending the newsletter.
Forms include (but are not limited to) "yaho.com", "yahho .com" etc.
Very annoying!

So i have been trying to update those record to the correct value.
After executing select email from users where email like '%@yaho%' and email not like '%yahoo%'; and getting the list, I'm stuck because I do not know how to update only the yaho part. I need the username to be left intact.

So I thought I would just dump the database and use vim to replace, but I cannot escape the @ symbol..

BTW, how do I select all email addresses written in CAPS? select upper(email) from users; would just transform everything into CAPS, whereas I just needed to find out the already-written-in-CAPS mails.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about email