OracleSQL内置函数的使用方法及结果(2)
文章作者 100test 发表时间 2007:03:14 13:57:19
来源 100Test.Com百考试题网
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
31.SIGH 返回双曲正弦的值
SQL> 0select sin(20),sinh(20) from dual.
SIN(20) SINH(20)
--------- ---------
.91294525 242582598
32.SQRT 返回数字n的根
SQL> 0select sqrt(64),sqrt(10) from dual.
SQRT(64) SQRT(10)
--------- ---------
8 3.1622777
33.TAN 返回数字的正切值
SQL> 0select tan(20),tan(10) from dual.
TAN(20) TAN(10)
--------- ---------
2.2371609 .64836083
34.TANH
返回数字n的双曲正切值
SQL> 0select tanh(20),tan(20) from dual.
TANH(20) TAN(20)
--------- ---------
1 2.2371609
35.TRUNC