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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章