REPLACE(str,from_str,to_str)
在字符串 str 中所有出现的字符串 from_str 均被 to_str替换,然后返回这个字符串:
mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'这个函数是多字节安全的。去下载中文参考手册吧。手册里都有的。
http://www.openphp.cn/index.php/download/3/9/index.html
在字符串 str 中所有出现的字符串 from_str 均被 to_str替换,然后返回这个字符串:
mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'这个函数是多字节安全的。去下载中文参考手册吧。手册里都有的。
http://www.openphp.cn/index.php/download/3/9/index.html
+-----------------------------------------+
| replace('I am Joe Cool','Cool','Camel') |
+-----------------------------------------+
| I am Joe Camel |
+-----------------------------------------+
1 row in set (0.13 sec)