去评论
dz插件网

求一个sql替换语句

哥斯拉
2023/09/15 11:18:32
https://xxx.com/wp-content/uploads/2023/03/15-21/16545646.png
https://xxx.com/wp-content/uploads/2023/03/15-21/589898.png

怎么把文章里的图片链接全部删除

UPDATE wp_posts SET post_content = CONCAT(
    SUBSTRING_INDEX(post_content, 'https://xxx.com/wp-content/uploads/', 1),
    '替换内容',
    SUBSTRING_INDEX(post_content, 'png', -1)
)  WHERE ID = 906832;



用这种替换会把  https://xxx.com/wp-content/uploads/到png的内容全部替换

怎么弄成 成对替换 https://xxx.com/wp-content/uploads/到png