以下查询在Oracle中运行时返回null
SELECT MAX(ROW_CREATION_TMSTP)
FROM RULES_REPOSITORY
WHERE rule_cd = 'LCC12G'
AND (TO_CHAR(expiration_dt,'DD-MON-YYYY HH24:MI:SS') > TO_CHAR(current_timestamp,'DD-MON-YYYY HH24:MI:SS'))
我的表格中有一行,列数为以下值
rule_cd = LCC12G
expiration_dt = '10 -JUN-13 03.51.12.000000000 AM'
ROW_CREATION_TMSTP = 10-APR-13 03.51.12.000000000 AM
通过查看值,它应该返回上面给出的ROW_CREATION_TMSTP的值,但它没有返回。
我错过了什么吗?
答案 0 :(得分:4)
SELECT MAX(ROW_CREATION_TMSTP)
FROM RULES_REPOSITORY
WHERE rule_cd = 'LCC12G'
AND expiration_dt > current_timestamp;
会好的..!