Oracle绝对值函数1.绝对值:abs()
select abs(-2) value from dual;
2.取整函数(⼤):ceil()
select ceil(-2.001) value from dual;(-2)
3.取整函数(⼩):floor()
select floor(-2.001) value from dual;(-3)
4.取整函数(截取):trunc()
select trunc(-2.001) value from dual; (-2)
5.四舍五⼊:round()
select round(1.234564) value from dual;(1.2346)
6.取平⽅:Power(m,n)
select power(4,2) value from dual;(16)
7.取平⽅根:SQRT()
select sqrt(16) value from dual;(4)
8.取随机数:dbms_random(minvalue,maxvalue)
select sys.dbms.random.value(0,1) value from dual;
9.取符号:Sign()
select sign(-3) value from dual;(-)
10,取集合的最⼤值:greatest(value)
select greatest(-1,3,5,7,9) value from dual;(9)
11.取集合的最⼩值:least(value)
select least(-1,3,5,7,9) value from dual;(-1)
12.处理Null值:nvl(空值,代替值)
select  nvl(null,10) value from dual;(10)
13.求字符序号:ascii()
select ascii(a) value from dual;
14.求序号字符:chr()
select chr(97) value from dual;
15.链接:concat()
select concat("11","22") value from dual;(1122)
16.获取系统时间:sysdate()
select sysdate value from dual;
17.求⽇期
select trunc(sysdate) from dual;
18.求时间
select  to_char(sysdate,"hh24:mm:ss") from dual;
trunc函数如何取整19.⾸字母⼤写:InitCAP()
select INITCAP(abc def ghi) value from dual;(Abc Def Ghi)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。