MySQL:REPLACE函数的使用

原文链接

REPLACE函数功能

REPLACE(columnName, search_str, replace_str)
查找columnName字段中所有search_str,并替换为replace_str

举例使用

源数据表

执行下面sql语句

UPDATE `tableName` SET `text`=REPLACE(`text`, '<!--markdown-->', 'newValue');

查找text字段中所有<!--markdown-->,并替换为newValue

结果

posted @ 2018-12-22 21:33  HarveyCC  阅读(151)  评论(0编辑  收藏  举报