字符串函数
– concat 连接两个字符串
select concat(‘abc’,‘ABC’) from dual;
select ‘abc’||‘ABC’ from dual;
select concat(first_name,’_’)||last_name con,t.* from EMPLOYEES t;
– initcap 返回字符串,第一个大写,其余小写
select initcap(email) from EMPLOYEES;
– length 返回字符串长度
select length(email),t.* from EMPLOYEES t;
– lower 所有字符小写
– upper 所有字符大写
select lower(first_name),upper(last_name),t.* from EMPLOYEES t;
– substr 字符串截取
select substr(‘123456789’,3,4) from dual;
从第 3个 截取,截取 4 个字符
– replace 字符串替换
select replace(‘he love you’, ‘he’, ‘i’) from dual;
I love you
数学函数
– CEIL 返回大于或等于给出数字的最大整数
select ceil(‘123.456789’) from dual;
select ceil(‘123’) from dual;
– FLOOR 返回小于或等于给出数字的最小整数
select floor(‘123.456789’) from dual;
– Round 函数进行四舍五入
select round(124.1666,-2),round(124.1666,2) from dual;
-2,小数点前两位,四舍五入
2,小数点前两位,四舍