-1

I have table with values like

Book ID    email1               email2
101        [email protected]     [email protected]
102        [email protected]     [email protected]
105        [email protected]     [email protected]

I want to update all the values of email1 and email2 from test.com to testmail.com

e.g [email protected]  to [email protected],
and  [email protected]   to   [email protected]  

how to write update query for this in mysql

Swadeshi
  • 1,596
  • 21
  • 33

1 Answers1

0
UPDATE table_name 
SET email1 = REPLACE(email1,'@test.com ','@testemail.com '), 
    email2 = REPLACE(email2,'@test.com ','@testemail.com ')
Nick
  • 138,499
  • 22
  • 57
  • 95
Mohamed CHIBANI
  • 147
  • 1
  • 1
  • 6