【发布时间】:2018-09-17 16:25:29
【问题描述】:
在搜索和浏览google寻求帮助后,我终于得到了我需要的代码。它工作正常。但...!它适用于 SELECT,但如何将其转换为 UPDATE 语句?
SELECT
post_content,
concat(
substr(post_content, 1, length(post_content) - length(substring_index(post_content,'<!--more-->',-1)) - 1))
FROM `wp_posts`
WHERE post_status='publish' AND post_type='post'
附:顺便说一句,它是 wordpress 数据库。
【问题讨论】:
-
您是否尝试将
UPDATE您的post_content列添加到您创建的表达式中?即 col1 到 col2? -
没错。
标签: mysql sql wordpress mariadb