Home  >  Article  >  Database  >  Oracle DB TO_CHAR、TO_DATE、TO_NUMBER 函数

Oracle DB TO_CHAR、TO_DATE、TO_NUMBER 函数

WBOY
WBOYOriginal
2016-06-07 17:32:26996browse

Oracle DB TO_CHAR、TO_DATE、TO_NUMBER 函数,TO_CHAR可以按照由format_model 指定的格式,将日期时间数据类型转换为数据类型为

示例中的SQL 语句显示所有雇员的姓氏和聘用日期。聘用日期显示为“17 June 1987”。

示例:

修改幻灯片中的示例,使其以“Seventeenth of June 1987 12:00:00 AM ”格式显示日期。

hr@TEST0924> SELECT last_name, TO_CHAR(hire_date, 'fmDdspth "of" Month YYYY fmHH:MI:SS AM') HIREDATE FROM employees;

 

LAST_NAME HIREDATE

------------------------- -----------------------------------------------------------------------

OConnell Twenty-First of June 2007 12:00:00 AM

Grant Thirteenth of January 2008 12:00:00 AM

Whalen Seventeenth of September 2003 12:00:00 AM

Hartstein Seventeenth of February 2004 12:00:00 AM

...

107 rows selected.

请注意,,月份将遵循指定的格式样式;换句话说,首字母为大写,其它字母为小写。

 

 

更多详情见请继续阅读下一页的精彩内容

 

相关阅读:

Oracle数据库中的函数,包和触发器

Oracle中窗口函数over()的学习

Oracle数据库生成随机数的函数

Oracle自定义函数查询数据字典项

Oracle日期函数/字符函数/数字函数/转换函数/聚合函数

Oracle中Decode()函数使用说明

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn