replace與regexp_replace區別使用以及like與instr差異

repalce(str_source,str1,str2) 把 str_source 中 str1 字符串替換爲 str2 字符串,
當 str2 爲 null 或'' 時,與下個作用相同

replace(str_source,str1) 把str_source 中的 str1 字符串剔除

regexp_replace(str_source,pattern_str) 把 str_source 中的 pattern_str 字符串剔除

Oracle中 like與instr之間的區別於聯繫:在沒有創建索引的情況下instr的效率較like能高一些但是相差不大
創建索引後like的效率比instr要高相差巨大

translate('目標字符串','源字符串','目的字符串') 當目標字符串與源字符串出現相同的字符時,
會被替換爲目的字符串


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章