mysql replace函数用法实例

时间:2015-11-14
mysql 中replace函数的作用是将某个字符串里面的字符替换为其他字符,本文讲解了replace函数的应用实例,大家可以参考一下。

语法:replace(object,search,replace) 
描述:把object中的search全部替换为replace。

实例如下:

UPDATE school_more_info SET comments = replace( comments, '�', "'" )

将comments字段中的特殊字符�替换为’。