【发布时间】:2014-03-21 17:29:01
【问题描述】:
对 MySQL 命令不太熟练。我习惯在 MySQL 中运行类似于
的命令UPDATE wp_posts SET post_content = REPLACE (post_content,'Item to replace here','Replacement text here');
用于查找旧 URL 和各种小块内容。但是这个命令搜索我所有的帖子,并找到/替换。我想要一个仅根据父项查找/替换内容的参数。我正在尝试以下效果:
UPDATE wp_posts
SET post_content
WHERE post_parent = 4860
= REPLACE (post_content,'old content','new content');
运气不佳。我做错了什么?
【问题讨论】:
-
UPDATE wp_posts SET post_content = REPLACE (post_content,'Item to replace here','Replacement text here') WHERE post_parent = 4860;