2

I have 100 email address in my mysql table and its look like [email protected], [email protected], [email protected], [email protected],[email protected], [email protected], ect.... I need to change all @xy.com to @xyz.com using mysql query.

Please help me for query

Thanks in advance!

2
  • replace(email, '@xy.com', '@xyz.com')? Commented Nov 9, 2015 at 9:34
  • You'll need to show some effort yourself. Just as a hint, you will be looking at using LIKE in the WHERE part. Commented Nov 9, 2015 at 9:34

1 Answer 1

3

You can try this:

update myTable
set email = replace(email, '@xy.com', '@xyz.com')
where email like '%@xy.com'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.