Comparison between MySQL and Oracle common functions and data types

Source: Internet
Author: User

Recently in a turn to the original use of Oracle, the intention to change the MySQL system, some of the common Oracle functions of the MySQL implementation by the way, mainly involved in the system (in fact, the original is specifically collated a detailed doc, only to find word trouble).

Characteristics Oracle Mysql
String to date To_date Str_to_date
Date type

Date

January 1, 4712 BC to December 31, 9999

DateTime: Range of values: +-0100:00:00 to 9999-31 23:59:59

Timestamp: Value range: 1970-01 00:00:00to 2037-31 23:59:59

Date to String To_char Date_format
Base64 Utl_raw.cast_to_varchar2 (Utl_encode.base64_encode (Utl_raw.cast_to_raw (' Base64_str '))) To_base64 (' Base64_str ')
Null value NVL (col1, ' default value ') Ifnull (col1, ' 99999999 ')
Logical judgment Decode (ttype,1, ' a ', 2, ' B ', 3, ' C ', ' d ') if (ttype=1, ' a ', if (ttype=2, ' B ', if (Ttype =3, ' C ', ' d ')))
Id Sequence Auto_increment
Number to String type To_char () Concat (Num_col, ")
String converted to numeric type To_number () Cast (' 1 ' as signed int)
To a microsecond of time Systimestamp Sysdate (6)

Comparison between MySQL and Oracle common functions and data types

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.