Differences between oracle and SQL (common functions) (2) _ MySQL

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.