This article mainly introduces the actual operations related to Oracle data type conversion to_char (date). If you are interested in the actual application solution of Oracle data type conversion, you can click the following article to learn more about it.
Oracle data type conversion includes explicit data type conversion and implicit data type conversion.
In general, implicit data type conversion is available, but we recommend that you convert the display data type to ensure the reliability of SQL. explicit data type conversion includes:
To_number character to number
To_date character to date
To_char numeric conversion to character
To_char date to TO_CHAR (date, 'format _ model ')
Must be enclosed in single quotes and case sensitive
Oracle data type conversion can contain any valid date format Element
There is a fm element used to delete the filled null, or the leading zero
Use a comma to separate the select employee_id, to_char (hire_date, 'Mm/yy') as month
- From employees
- Where last_name = 'higgin'
- Employee_id month
- 205 06/94
- Select to_char (sysdate, 'yyyy-mm-dd hh24: mi: ss am') as today from dual
- January 13:39:06 select to_char (to_date ('21--95 '), 'yyyy-mm-dd hh24: mi: ss am') as today from dual
- 00:00:00 select to_char (sysdate, 'dd "of" month ') from dual
- 24 of June select to_char (syadate, 'yyyy-mm-dd CC') from dual
- 2006-06-24 21
- Cc: century select to_char (sysdate, 'yyy-mm-dd CC') as today from dual
- 006-06-24 21
- Select to_char (sysdate, 'yy-mm-dd CC') as today from dual
- 06-06-24 21
- Select to_char (sysdate, 'y, yyy-mm-dd CC') as today from dual
- 2,006-06-24 21
The above content is an introduction to Oracle data type conversion. I hope you will find some gains.