hello,
How do I replace a character in MySQL? I have an email column which fields have a '/' and I would like to replace all slashes into a - (dashes). So for example, if the field is 'test/email@test.com', i want it to be changed to 'test-email@test.com'. There are plenty of rows with this problem so what is the best way to get around this?
Thank you so much!
-Renny
Use the replace() function.
Let's say the field you want to update is 'email' ... you could do this:
update TABLE_NAME set email=replace(email, '/', '-');
That will replace all "/" characters with a dash "-".
-- Jason