我想根据 3 个条件在 MySQL(Wordpress 网站)中查找 guid 列。我在 phpMyAdmin 中搜索,准确地找到了我正在寻找的结果。
不幸的是,我无法替换 SQL 中选定的 GUID:
SELECT *
FROM `wp_posts`
WHERE `post_date` LIKE '%2012-03%'
AND `guid` NOT REGEXP 'http://www.'
AND `post_type` = 'attachment'
REPLACE(guid,'http://', 'http://www.mydomain.org/wp-content/uploads/2012/03/')
上面的替换代码不起作用。我必须在 SQL (phpMyAdmin) 中运行什么才能从上述 3 个条件中查找?
(WHERE `post_date` LIKE '%2012-03%'
AND `guid` NOT REGEXP 'http://www.'
AND `post_type` = 'attachment')
并将 guid 列从“http://”替换为“http://www.mydomain.org/wp-content/uploads/2012/03/” '.
最佳答案
尝试更新而不是替换
该网站专门更改了 word press 上的 guid 中的 url Have a look
关于mysql - 根据 3 个条件查找并在 MySQL 中替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20669333/