Solved

Replace Text in Email

Posted on 2011-03-21
1
261 Views
Last Modified: 2012-05-11
I am trying to employ some logic to take the first three characters of an email and replace the rest with some arbitrary value. However, I want to retain the domain. For example,

thisismyemail@yahoo.com would be changed to thitest123@yahoo.com.

Does anyone know how to use the REPLACE command in MySQL to accomplish this?
0
Comment
Question by:plecostomus
1 Comment
 
LVL 2

Accepted Solution

by:
chedlin earned 500 total points
ID: 35182292
I'm writing from an MsSQL developer point of view, but after double checking the documentation REPLACE won't do it.

This should  work:

LEFT(email, 3) + 'replacement text' +  SUBSTR(email, LOCATE('@', email))
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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