Link to home
Create AccountLog in
Avatar of crazywolf2010
crazywolf2010Flag for United Kingdom of Great Britain and Northern Ireland

asked on

MySQL update statement help

Hi,
I have mysql table with following data.
I need a small change ,I need to alter email address as below.

Each email like cruz.ashley62@testmail.com need to change as cruz.ashley62+ mydomain@gmail.com
How can I write an update statement for it?

User generated image2013-05-20-20-21-30-pluto.server.png
Avatar of dsacker
dsacker
Flag of United States of America image

update YourTable
set email = replace(email, 'testmail.com', 'gmail.com')
where email like '%testmail.com'
SOLUTION
Avatar of dsacker
dsacker
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account