Solved

Replace Text in Email

Posted on 2011-03-21
1
258 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Loading csv or delimited data files to MySQL database is a very common task frequently questioned about and almost every time LOAD DATA INFILE comes to the rescue. Here we will try to understand some of the very common scenarios for loading data …
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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