I looked up a discussion in SO with the link below : Replace multiple characters in SQL
What I am not able to understand is why the query is not working for :
select table_value,
replace(replace(replace(table_value, 'M', 'MEETING'), 'E', 'EMAIL'), 'P', 'PHONE') required_value
from foobar
I am a beginner learner in SQL and want to understand what's wrong with the above query ? I'd appreciate if someone could help me picturise the backend working here.
The accepted answer in that blog is not the ultimate solution. I wanna know what to do when I come across a situation where there are multiple strings in a column which needs to be replaced?
Is there an easy and efficient alternative or not?
Thanks in advance