Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query Syntax 17 43
Query Help - MSSQL - Averages 5 30
SQL Server - Set Field Values ito Zero Based on Related Table 4 40
how to access a remote mysql database with xampp 3 24
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 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