Reputation: 1182
Is it possible in mysql to replace a character and all characters to the left with a string.
so if I have a table with
[email protected]
[email protected]
it becomes
www.abc.com
www.123.co.uk
afraid I have no idea where to begin :(
Upvotes: 1
Views: 58
Reputation: 1182
I did it with
concat("www.",SUBSTRING_INDEX(e.email, '@', -1))
Upvotes: 0
Reputation: 72235
You can do:
UPDATE mytable
SET email = CONCAT('www.', SUBSTRING_INDEX(email, '@', -1))
Upvotes: 3