关于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') 

 

posted on 2023-01-10 11:45  大山008  阅读(201)  评论(0)    收藏  举报