Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
to_char(to_date(A.PERMISSION_USE_DT, 'YYYY-MM-DD')) < to_char(to_date(sysdate, 'YYYY-MM-DD'))
A.PERMISSION_USE_DT当前格式为04/12/2013; 如果日期早于系统日期,我想检查并匹配。我该怎么做呢?
A.PERMISSION_USE_DT
04/12/2013
如果 A.Permission_Use_Dt 是日期类型,则无需进行 TO_CHAR/TO_DATE 转换。只需这样做:
A.Permission_Use_Dt < SYSDATE
请注意,SYSDATE 也有一个时间组件,所以现在是今天的日期和时间。要仅比较值的日期部分,请执行以下操作:
TRUNC(A.Permission_Use_Dt) < TRUNC(SYSDATE)