Oracle中replace()函數的使用


一般情況下,更新sql語句:update demo set name = 'XX' where name = 'YY';

 

有的時候,需要用到replace()函數

使用的函數為replace()
含義為:替換字符串
replace(原字段,“原字段舊內容“,“原字段新內容“,)

例如:

 

 

需要把name里面的“醫院”改成“醫2院”

就會用到replace()函數

update demo set name = replace(name,'醫院','醫2院') where name like '%醫院%';
update demo set name = replace(name,'醫院','醫2院')


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM