A function that converts a date into characters:
To_char (Date[,fmt[,params])
Default format: DD-MON-RR
Parameter description:
Date: Dates that will be loaded
FMT: Format for swapping
Params: The language of the date (can not be written)
Example:
Sql> Select To_char (sysdate, ' Yyyy-mm-dd HH24:MI:SS ') from dual;
To_char (sysdate, ' YY
-------------------
2016-04-21 07:55:54
A function that converts a character type into a date:
To_date (Char[,fmt[,params])
Example:
Sql> Select To_date (' 2015-05-22 ', ' YYYY-MM-DD ') from dual;
To_date (' 2015-
--------------
2 February-May-15
3. Convert numbers into characters
To_char (Number[,fmt]):
Number indicates the format to convert, and the FMT represents the converted
Value of FMT:
[9] Indicates that the number is displayed and ignores the previous 0,
[0] indicates that the number is displayed, the number of bits is insufficient, with 0
[. or d] indicates that the decimal point is displayed,
[, or G] indicates the display of the thousand characters,
[$] Represents a dollar symbol,
[S] indicates the plus sign (both front and rear can)
Example:
Sql> Select To_char (12345.678, ' $99,999.999 ') from dual;
To_char (1234
------------
$12,345.678
Sql> Select To_char (12345.678, ' $99,999,999 ') from dual;
To_char (1234
------------
$12,346
(No decimal point will be rounded up and swapped)
The characters are replaced with numbers:
To_number (Char[,fmt])
Example:
Sql> Select To_number (' $1,000 ', ' $9999 ') from dual;
To_number (' $1,000 ', ' $9999 ')
---------------------------
1000
Load changer functions in Oracle