【发布时间】:2012-04-23 06:27:33
【问题描述】:
我对 Oracle 有点不满意
下面是我的SQL
select * from orders where
trunc(ordered_date)
between
to_date('01-JAN-12')
and
to_date('07-JAN-12')
Ordered_date 是 DATE 数据类型
是否出现以下错误。
Error starting at line 1 in command:
select * from orders
where
trunc(ordered_date)
between
to_date('01-JAN-12')
and
to_date('07-JAN-12')
Error report:
SQL Error: ORA-01841: (full) year must be between -4713 and +9999, and not be 0
01841. 00000 - "(full) year must be between -4713 and +9999, and not be 0"
*Cause: Illegal year entered
*Action: Input year in the specified range
我很困惑是什么导致了 mu 代码中的这个错误。
任何输入都会很棒。
谢谢!!!
【问题讨论】:
-
请运行这个:
SELECT TO_CHAR(ordered_date,'YYYY') FROM orders并发布结果。
标签: sql database oracle oracle10g oracle9i