组函数和表关系

组函数和表关系:

字符串函数

– 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;

猜你喜欢

转载自blog.csdn.net/longhuu/article/details/108456724