Oracle replace 的函数用法

replace 函数用法如下:

replace('将要更改的字符串','被替换掉的字符串','替换字符串')

例:select  replace ('111222333444','222','888') from dual;

输出为 '111888333444'


sql:例子

update t_gov_news_detail t
   set t.content = replace(replace(t.content,
                                   'src="',
                                   'src="http://www.ddk.gov.cn/'),
                           'href="',
                           'href="http://www.ddk.gov.cn/')
 where t.content like '%src="%'
    or t.content like '%href="%';


发布了42 篇原创文章 · 获赞 13 · 访问量 14万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章