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.
如何计算 (sysdate) 与hiredatePL/SQL 中调用的列之间的天数。
hiredate
谢谢。
您可以尝试以下方法:
SELECT TRUNC(sysdate) - TRUNC(t.hiredate) FROM myTable t;
这将导致以十进制表示的天数。时间戳将TRUNC确保您在连续调用中获得一致的结果。
TRUNC
select round((months_between(sysdate,hiredate) * 30),0) from table