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