开发者

Count the number of days between today & the hiredate in Oracle SQL?

How can I cou开发者_开发知识库nt the number of days between (sysdate) & a column called hiredate in PL/SQL.

Thanks.


You could try the following:

SELECT TRUNC(sysdate) - TRUNC(t.hiredate) FROM myTable t; 

This will result in a count of days represented in decimal. The TRUNC of the timestamps will ensure that you will get a consistent result on successive calls.


select round((months_between(sysdate,hiredate) * 30),0) from table
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜