【发布时间】:2015-03-26 03:56:47
【问题描述】:
我正在尝试在 Oracle 中将日期从 YYYYMMDD 转换为 DD-Mon-YYYY,但 to_char 或 to_Date 不起作用。可以请教吗?
select to_date(20150324,'DD-Mon-YY') from dual;
select to_char(20150324,'DD-Mon-YY') from dual;
我收到一条错误消息:- ORA-01861: literal does not match format string
【问题讨论】:
-
"TO_DATE converts [characters] .. to a value of DATE datatype." - 看看这个函数做了什么,以及如何使用参数,对于初学者来说。