The following articles mainly compare SQL Server and common Oracle functions. This article mainly introduces the specific content of common functions related to mathematical functions and trigonometric functions. The following describes the specific solution, I hope this will help you in your future studies.
Mathematical functions
1. Absolute Value
- S:select abs(-1) value
- O:select abs(-1) value from dual
2. INTEGER (large)
- S:select ceiling(-1.001) value
- O:select ceil(-1.001) value from dual
3. Smaller values)
S: select floor (-1.001) value
O: select floor (-1.001) value from dual
4. Integer truncation)
S: select cast (-1.002 as int) value
O: select trunc (-1.002) value from dual
5. Rounding
S: select round (1.23456, 4) value 1.23460
O: select round (1.23456, 4) value from dual 1.2346
6. e is the base power
S: select Exp (1) value 2.7182818284590451
O: select Exp (1) value from dual 2.71828182
7. Take the base logarithm of e.
S: select log (1, 2.7182818284590451) value 1
O: select ln (2.7182818284590451) value from dual; 1
8. Use 10 as the base logarithm.
S: select log10 (10) value 1
O: select log (10, 10) value from dual; 1
9. Square
S: select SQUARE (4) value 16
O: select power (4, 2) value from dual 16
10. Take the square root
S: select SQRT (4) value 2
O: select SQRT (4) value from dual 2
11. Evaluate the base power of any number
S: select power (3, 4) value 81
O: select power (3, 4) value from dual 81
12. Random Number acquisition
S: select rand () value
O: select sys. dbms_random.value (0, 1) value from dual;
13. Get the symbol
S: select sign (-8) value-1
O: select sign (-8) value from dual-1
Trigonometric correlation
14. Circumference Rate
S: select pi () value 3.1415926535897931
O: select acos (-1) from dual 3.1415926535897932384626433832795028842.
15. sin, cos, and tan parameters are in radians.
S: SELECT sin () value
O: SELECT sin () value from dual
16. Asin, Acos, Atan, and Atan2 parameters are all in radians.
S: SELECT Asin () value
O: SELECT Asin () value from dual
17. radian angle Interchange
S: DEGREES: RADIANS-> Angle RADIANS: Angle-> RADIANS
O: no built-in radians and angle conversion functions are provided.
Comparison between values
18. Calculate the maximum value of the Set
- S:select max(value) value from
- (select 1 value
- union
- select -2 value
- union
- select 4 value
- union
- select 3 value)a
- O:select greatest(1,-2,4,3) value from dual
The above content is a description of the comparison between SQL Server and common Oracle functions, hoping to help you in this regard.