Solved

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

Posted on 2008-10-26
1
457 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now