select t.*
from (select tt.strapprovedocunid,
tt.strcurapprover,
tt.strsubject,
tt.strflowname,
tt.strcurnodename,
to_date(tc.strpreactiontime,
'yyyy-MM-dd hh24:mi:ss') dtpreactiontime
from tbtodo tt,
context tc
where tt.strcurnodename not like
'拟稿人%'
and tt.strnodeposition <> '结束'
and tt.strapprovedocunid =
tc.strapprovedocunid
and tc.strpreactiontime is not null
and tc.strpreactiontime <> ' ') t
where t.dtpreactiontime >=cast(TO_DATE('2010-01-01 00:00:00',
'YYYY-MM-DD HH24:MI:SS') as
timestamp)
and t.dtpreactiontime
'YYYY-MM-DD HH24:MI:SS') as
timestamp)
and sysdate -
t.dtpreactiontime >= 1
下面这部分执行没问题
select t.*
from (select tt.strapprovedocunid,
tt.strcurapprover,
tt.strsubject,
tt.strflowname,
tt.strcurnodename,
to_date(tc.strpreactiontime,
'yyyy-MM-dd hh24:mi:ss') dtpreactiontime
from tbtodo tt,
context tc
where tt.strcurnodename not like
'拟稿人%'
and tt.strnodeposition <> '结束'
and tt.strapprovedocunid =
tc.strapprovedocunid
and tc.strpreactiontime is not null
and tc.strpreactiontime <> ' ') t
加了where后面的任意一个条件 也报 ORA-01841:完整的年份值必须介于-4713和+9999之间且不为0
把to_date(tc.strpreactiontime,
'yyyy-MM-dd hh24:mi:ss') dtpreactiontime
改成
to_date(trim(tc.strpreactiontime),
'yyyy-MM-dd hh24:mi:ss') dtpreactiontime 又可以了