sql数学函数(国外英文资料).doc
文本预览下载声明
sql数学函数(国外英文资料)
The mathematical function
Absolute value of 1.
S: select abs (-1) value
O: select abs (-1) value from dual
Take the whole (big)
S: select ceiling (-1.001) value
O: select ceil (-1.001) value from dual
Take the whole (small)
S: select floor (-1.001) value
O: select floor (-1.001) value from dual
Take an entire (intercept)
S: select cast (-1.002 as int) value
O: select trunc (-1.002) value from dual
5. Rounded
S: select round (1.23456, 4) value 1.23460
O: select round (1.23456, 4) value from dual 1.2346
6. E at the bottom of the power
S: select Exp (1) value 2.7182818284590451
O: select Exp (1) value from dual 2Take the log of e
S: select log (2.7182818284590451) value 1
O: select ln (2.7182818284590451) value from dual; 1
Take the base of 10
S: select log10 (10) value 1
O: select log (10, 10) value from dual; 1
Take square 9.
S: select SQUARE (4) value 16
O: select power (4, 2) value from dual 16
Take the square root 10.
S: select SQRT (4) value 2
O: select SQRT (4) value from dual 2
I want any power of the base
S: select power (3, 4) value 81
O: select power (3, 4) value from dual 81
Take a random number 12.
S: select rand () value
O: select sys. Dbms_random. Value (0, 1) value from dual;
13. Take a symbol
S: select sign (-8) value -1
O: select sign (-8) value from dual -1
The trig function
14. PI
S: SELECT PI () value 3.1415926535897931
O: I dont know
Sine, cosine, and tangent are all in radians
For example, select sin (PI () / 2) value is 1 (SQLServer)
Asin, Acos, Atan, Atan2 return radians
(SQLServer, Oracle doesnt know)
DEGREES: radian- Angle
RADIANS: Angle - RADIANS
The numerical comparison between the values
Maximize the set
S: select Max (value) value from
(select 1 value
The union
Select - 2 value
The union
Select 4 value
The union
Select 3 value) a.
O: select greatest (1, -2, 4, 3) value from dual
Find the minimum set
S: select min (value) value from
(select 1 value
The union
Select - 2 value
The union
Select 4 value
The union
Sel
显示全部