Differences between oracle and SQL (common functions) (2) ORACLE functions
BitsCN.com
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 power S of an arbitrary number: 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 function correlation
14. circumference rate S: select pi () value 3.1415926535897931
O: unknown
15. sin, cos, and tan parameters are in radians.
For example, select sin (PI ()/2) value to get 1 (SQLServer)
16. Asin, Acos, Atan, Atan2 return radians
17. radian angle interchange (, Oracle unknown)
DEGREES: Radian-> angle
RADIANS: Angle-> Radian
--------- Comparison of 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)
O: select greatest (1,-2, 4, 3) value from dual
19. minimum value of the set
S: select min (value) value from
(Select 1 value
Union
Select-2 value
Union
Select 4 value
Union
Select 3 value)
O: select least (1,-2, 4, 3) value from dual
20. how to handle the null value (null in F2 is replaced by 10) S: select F1, IsNull (F2, 10) value from Tbl O: select F1, nvl (F2, 10) value from Tbl
-------- String functions
21. search for the character serial number
S: select ascii ('A') value
O: select ascii ('A') value from dual
22. calculate characters from the serial number
S: select char (97) value
O: select chr (97) value from dual
23. connection
S: select '11' + '22' + '33' value
O: select CONCAT ('11', '22') | 33 value from dual
23. substring location -- returns 3 S: select CHARINDEX ('s', 'sdsq', 2) value O: select INSTR ('sdsq', 'S', 2) value from dual
23. position of the fuzzy substring -- 2 is returned. If % is removed from the parameter, 7 is returned //
BitsCN.com