1.字符转大写-UPPER
select UPPER('hello') from dual;
2.字符转小写
select LOWER('Hello') from dual;
ps: oracle 是大小写不敏感的
3.首字母大写
select initcap('hello') from dual;
4.字符拼接
select concat('hello','world') from dual;
select 'hello'||'world' from dual;
5.字符串截取
select substr(str,起始位置,截取数量)
**注意:起始位置 填0或者1 都是指第一个字符**
这里-n的意思是从后面开始数第n个为起始位子
select substr(str,-n,4) from dual;
4.取字符串长度
select length(str) from ..
5.字符串替换
select replace(str,str中的字符,替换之后的字符) from dual;
如果字符不在str中,则不替换
6.字符串填充
--左填充
select lpad('hi',10,'*') from dual;
--右填充(rpad)
7.字符串查找
select instr('111222333','22') from dual;
--查找结果
INSTR('111222333','22')
-----------------------
4