ORACLE常用字符函数

小写字母转大写字母:upper();


大写字母转小写字母:lower();


字符串截取函数:substr(str,a,b);

a,b为整数,str为字符串,

截取字符串str从a开始的b位字符,当a为-1时从字符串右边至左开始查找,

例:select substr('abcd',2,2) from dual;

---返回bc;


字符串连接:||

例:select 'ab'||'cd' from dual;

---返回abcd;


字符查找函数:instr(str,a,b)

a为要查找的字符,b为整数,str为字符串,

查找字符串str中a第一次出现的位置,b表示从str的第几位开始查找,可以缺省,

例:select instr('abcdce','c') from dual;

--返回3;


字符替换函数:replace(str,a,b)

str为字符串,a为被替换的字符,b为要替换成的字符,

例:select replace('abcdce','bc','test') from dual

--返回atestdce 



 

posted on 2008-12-03 11:37  不过  阅读(1712)  评论(0编辑  收藏  举报

导航