MySQL:REPLACE函数的使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yao1500/article/details/85218257

原文链接

REPLACE函数功能

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

举例使用

源数据表

执行下面sql语句

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

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

结果

猜你喜欢

转载自blog.csdn.net/yao1500/article/details/85218257