这段替换的意思是将dede_addonarticle表里的body字段里的#p#替换为空
update dede_addonarticle set body=replace(body,'#p#','') where typeid=1;
下面是sql的常用语法
update '表名' set body=replace(字段名,'需要替换的','现在的');
如:
update 'dede_addonarticle' set body=replace(body,'百度','谷歌');
update 'dede_archives' set title=replace(title,'百度','谷歌');
update 'dede_archives' set description=replace(description,'百度','谷歌');
如需要指定ID 只需要加上where typeid=* 即可完成指定
文章由badcat读书网(http://www.badcatxt.com)编辑整理
本文介绍了一种使用SQL更新语句进行字符串替换的方法,通过实例展示了如何在特定字段中替换指定内容,并提供了针对不同表和字段的示例。
909

被折叠的 条评论
为什么被折叠?



