Solved

MySQL query to change domain of all email addresses in a field

Posted on 2008-10-26
1
464 Views
Last Modified: 2008-10-26
I have a `users` table with a field called emailaddress with about 1500 records... each of them has the same domain associated with it..

user1@dallasray.com
user2@dallasray.com
user3@dallasray.com

We are switching to a new domain so how can I write a query that was find all instances of @dallasray.com and replace them with @southtexastech.com  ?

user1@southtexastech.com
user2@southtexastech.com
user3@southtexastech.com

etc.

thank you!
0
Comment
Question by:smetterd
1 Comment
 
LVL 27

Accepted Solution

by:
yodercm earned 500 total points
ID: 22808057
UPDATE users SET emailaddress=REPLACE(emailaddress,'@dallasray.com','@southtexastech.com')
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
table joins in qry 17 82
How to extract database info from current month and year 7 32
Setting variables in a stored procedure 5 46
T-SQL Query - Group By Year 3 25
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question