Kaustubh
Kaustubh

Reputation: 506

How to Mask user email addresses with different domain in MYSQL

I want to replace user domains with some other domains in mysql. for eg. I want to change :

[email protected] to [email protected].

Upvotes: 2

Views: 913

Answers (2)

Kaustubh
Kaustubh

Reputation: 506

I also have tried this and it worked as well.

update table1 set email =concat(SUBSTRING(email,1,INSTR(  email,'@'  )),'abxy.com')

Upvotes: 1

flyingfox
flyingfox

Reputation: 13506

Your questions is not very clear,you can use REPLACE if you just need to change the domain of it,similar sql as below:

UPDATE table1 SET address=REPLACE(address,'@rocket.com','@abxy.com')

Upvotes: 3

Related Questions