MySQL/Oracle 更新或替换字符串字段中的部分内容
MySQL Oracle 大约 272 字语法
UPDATE `table_name` SET `field_name` = REPLACE(`field_name`, 'from_str', 'to_str') WHERE `field_name` LIKE '%from_str%';
案例
去除字符串中的url链接
UPDATE `URL_LINK` set `content` = REPLACE(`content`, 'http://www.zhangbj.com/','') where `content` LIKE '%http://www.zhangbj.com/%'
阅读 2945 · 发布于 2020-01-14
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称: