Randy (r0ndy) wrote in mysql,
Randy
r0ndy
mysql

REGEX in MYSQL?

Say I have a table that looks like this..

EMAIL
-----
jon@mydomain.com
ted@mydomain.com
jill@mydomain.com
nikki@mydomain.com
bob@mydomain.com
.
.
.

And I want to make an SQL statement to change the domain of the email address so the records look like this:

jon@anotherdomain.com
ted@anotherdomain.com
jill@anotherdomain.com
nikki@anotherdomain.com
bob@anotherdomain.com

Has anyone ever done anything like this? Sort of a search-and-replace via SQL. Any help would be appreciated.

Randy
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 13 comments