SQL替换字段中部分字符

xiaoxiao2021-02-27  164

update 表名 set 字段= replace(字段,'原字符','新字符');

示例:

tb_item表中image字段中一数据为:jd/4ef8861cf6854de9889f3db9b24dc371.jpg

update tb_item set image = replace(image,'jd','taobao');

替换后:

taobao/4ef8861cf6854de9889f3db9b24dc371.jpg

转载请注明原文地址: https://www.6miu.com/read-15360.html

最新回复(0)