mysql 替换内容指定字符

使用mysql中的replace函数

update `table` set content=replace(content,'要替换的字符','替换后的字符');

如果要替换符合条件的数据后面加where条件

update `附表` set content=replace(content,'要替换的字符','替换后的字符') where id in(select id from `主表` where 条件) 替换附表的内容

posted @ 2021-12-04 15:34  时间掉飞机  阅读(865)  评论(0编辑  收藏  举报