select l_code from table1
where (to_date(g_sendtime,'yyyy-mm-dd hh24:mi')-to_date(g_indate,'yyyy-mm-dd hh24:mi') >(1/24/60)*30
以上语法执行正确,但我需要计算count就出错了
select count(*) from table1
where (to_date(g_sendtime,'yyyy-mm-dd hh24:mi')-to_date(g_indate,'yyyy-mm-dd hh24:mi') >(1/24/60)*30
错误是ora-01861:文字与格式字符串不匹配
where (to_date(g_sendtime,'yyyy-mm-dd hh24:mi')-to_date(g_indate,'yyyy-mm-dd hh24:mi') >(1/24/60)*30
以上语法执行正确,但我需要计算count就出错了
select count(*) from table1
where (to_date(g_sendtime,'yyyy-mm-dd hh24:mi')-to_date(g_indate,'yyyy-mm-dd hh24:mi') >(1/24/60)*30
错误是ora-01861:文字与格式字符串不匹配
类似这样写写
zxf2@ORCL(192.168.21.110)> select count(*) from ttt1
2 where sysdate-numtodsinterval(30,'minute')>to_date('2009-01-03','yyyy-mm-dd hh24:mi:ss'); COUNT(*)
----------
2
TO_DATE('200901010807', 'yyyy-mm-dd hh24:mi') - 50
FROM DUAL;