在SQL中更新替换字符串

meShell · 2022年03月22日 · 阅读 951

T-SQL:

update TBL 
   set picture = Replace(picture, 'servera', 'serverb') 
 where picture like '%servera%'

Oracle:

update TBL 
   set picture = replace(picture, 'servera', 'serverb') 
 where picture like '%servera%'

MySQL:

update TBL 
   set picture = REPLACE(picture, 'servera', 'serverb') 
 where picture like '%servera%'

关于作者

全栈工程师

文章被阅读 53.0k
获赞 3