Solved

Replace Text in Email

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

895 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

13 Experts available now in Live!

Get 1:1 Help Now