关于replace(): MySQL批量替换指定字段字符串
UPDATE tb1 SET f1=REPLACE(str,from_str,to_str)
在字符串 str 中所有出现的字符串 from_str 均被 to_str替换,然后返回这个字符串
实例:
update base_gift set img_url=replace(img_url,'http://****/draw_lottery','http://****:2002/draw_lottery')
UPDATE tb1 SET f1=REPLACE(str,from_str,to_str)
在字符串 str 中所有出现的字符串 from_str 均被 to_str替换,然后返回这个字符串
实例:
update base_gift set img_url=replace(img_url,'http://****/draw_lottery','http://****:2002/draw_lottery')