110个oracle常用函数总结(2)Oracle认证考试
文章作者 100test 发表时间 2009:11:11 17:28:40
来源 100Test.Com百考试题网
"tbbnc">
21.返回一个数字反余弦值
SQL>. 0select cosh(20) from dual.
COSH(20)
---------
242582598
22.EXP
返回一个数字e的n次方根
SQL>. 0select exp(2),exp(1) from dual.
EXP(2) EXP(1)
--------- ---------
7.3890561 2.7182818
23.FLOOR
对给定的数字取整数
SQL>. 0select floor(2345.67) from dual.
FLOOR(2345.67)
--------------
2345
24.LN
返回一个数字的对数值
SQL>. 0select ln(1),ln(2),ln(2.7182818) from dual.
LN(1) LN(2) LN(2.7182818)
--------- --------- -------------
0 .69314718 .99999999
25.LOG(n1,n2)
返回一个以n1为底n2的对数
SQL>. 0select log(2,1),log(2,4) from dual.
LOG(2,1) LOG(2,4)
--------- ---------
0 2
26.MOD(n1,n2)
返回一个n1除以n2的余数
SQL>. 0select mod(10,3),mod(3,3),mod(2,3) from dual.
MOD(10,3) MOD(3,3) MOD(2,3)
--------- --------- ---------
1 0 2
27.POWER
返回n1的n2次方根
SQL>. 0select power(2,10),power(3,3) from dual.
POWER(2,10) POWER(3,3)
----------- ----------
1024 27
28.ROUND和TRUNC
按照指定的精度进行舍入
SQL>. 0select round(55.5),round(-55.4),trunc(55.5),trunc(-55.5) from dual.
ROUND(55.5) ROUND(-55.4) TRUNC(55.5) TRUNC(-55.5)
----------- ------------ ----------- ------------
56 -55 55 -55
29.SIGN取数字n的符号,大于0返回1,小于0返回-1,等于0返回0 SQL>. 0select sign(123),sign(-100),sign(0) from dual.
SIGN(123) SIGN(-100) SIGN(0)
--------- ---------- ---------
1 -1 0
30.SIN
返回一个数字的正弦值
SQL>. 0select sin(1.57079) from dual.
SIN(1.57079)
------------
1