Solved

Replace Text in Email

Posted on 2011-03-21
1
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

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.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

623 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