I have a users table with a user_email field. I'd like to replace all user emails that match:
- *@a.com
- *@b.com
- *@c.com
With a randomly chosen string from
- d.com
- e.com
- f.com
- g.com
Example:
Before:
--------------------------------------
|user_name | user_email | user_phone |
--------------------------------------
| greg | [email protected] | 12345 |
--------------------------------------
| harry | [email protected] | 12345 |
--------------------------------------
| mary | [email protected] | 12345 |
--------------------------------------
| john | [email protected] | 12345 |
--------------------------------------
| fred | [email protected] | 12345 |
--------------------------------------
| alfred | [email protected] | 12345 |
--------------------------------------
After (Replace all "a.com", "b.com", "c.com" occurrences with a randomly chosen one from ["d.com", "e.com", "f.com", "g.com"]:
--------------------------------------
|user_name | user_email | user_phone |
--------------------------------------
| greg | [email protected] | 12345 |
--------------------------------------
| harry | [email protected] | 12345 |
--------------------------------------
| mary | [email protected] | 12345 |
--------------------------------------
| john | [email protected] | 12345 |
--------------------------------------
| fred | [email protected] | 12345 |
--------------------------------------
| alfred | [email protected] | 12345 |
--------------------------------------
John, and Fred remain unchanged. Greg, Harry, Mary, and Alfred get one from ["d.com", "e.com", "f.com", "g.com"] randomly.
Any pointers on how to do this? Thank you