1、单行函数—字符函数
字符函数
Upper
SELECT Upper ('abcde') FROM dual ;
SELECT * FROM emp WHEREename=UPPER('smith') ;
Lower
SELECT lower('ABCDE') FROM dual ;
Initcap
函数INITCAP()是将每个单词的第一个字母大写,其它字母变为小写返回.
Select initcap(ename) from emp;
Concat
Select concat(‘a’,’b’) from dual;
Select ‘a’|| ‘b’from dual;
Substr
Select substr(„abcde‟,length(„abcde‟)-2)from dual;
Select substr(„abcde‟,-3,3) from dual;
Length
select length('abcde') from dual;
Replace
select replace ('abcdeffddses','s','j') from dual;
Instr
Instr(a,b) 找出字符串b在字符串a中出现的下标位置
Select instr('Hello World','or') from dual;8 indexof
Lpad
lpad('Smith',10,'*') 左侧填充lpad() *****Smith
select lpad('Smith',10,'*') from dual;
Rpad
rpad('Smith',10,'*') 右侧填充rpad()Smith*****
select rpad('Smith',10,'*') from dual;
Trim
trim(' Mr Smith ')过滤首尾空格trim() Mr Smith
select trim(' Mr Smith ') from dual;