REPLACE(str,fromStr,toStr)
When you want to replace a string from other string in a string then you can use REPLACE function. REPLACE function returns the string str with all occurrences of the string from Str and replace it by the string to Str. REPLACE() function is a case-sensitive match when searching for fromStr.
mysql> SELECT REPLACE('Hello SQL','SQL','MySQL');
+------------------------------------+
| REPLACE('Hello SQL','SQL','MySQL') |
+------------------------------------+
| Hello MySQL |
+------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT REPLACE('Hello SQL','sql','MySQL');
+------------------------------------+
| REPLACE('Hello SQL','sql','MySQL') |
+------------------------------------+
| Hello SQL |
+------------------------------------+
1 row in set (0.01 sec)
0 Comment(s)