SELECT lastmoddate
, to_timestamp(lastmoddate,'DD-MON-YYYY HH:MI:SS:FF AM')
, cast(current_timestamp - interval '60' day as TIMESTAMP)
FROM table
WHERE primaryKeyColumn = 12141969;
返回:
SELECT problemid
, lastmoddate
, to_timestamp(lastmoddate,'DD-MON-YYYY HH:MI:SS:FF AM')
, cast((current_timestamp - 60) as TIMESTAMP)
FROM table
WHERE primaryKeyColumn = 12141969
and to_timestamp(lastmoddate,'DD-MON-YYYY HH:MI:SS:FF AM') < cast((current_timestamp - 60) as TIMESTAMP);
返回:
我不知道8月25日要比8月19日少。
答案 0 :(得分:0)
感谢所有人,尤其是戈登,加里。你们钉了它。当我运行to_CHAR(lastmoddate,'DD-MON-YYYY HH24:MI')时,我注意到它在Year中存储了0018。这解决了我的问题