计算今天和明天之间的天数Oracle SQL 中的hiredate?

发布于 2024-09-07 05:20:22 字数 78 浏览 6 评论 0原文

如何计算 (sysdate) 和; 之间的天数PL/SQL 中名为 hiredate 的列。

谢谢。

How can I count the number of days between (sysdate) & a column called hiredate in PL/SQL.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

江南月 2024-09-14 05:20:22

您可以尝试以下操作:

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

这将导致以十进制表示的天数。时间戳的 TRUNC 将确保您在连续调用中获得一致的结果。

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.

小嗲 2024-09-14 05:20:22
select round((months_between(sysdate,hiredate) * 30),0) from table
select round((months_between(sysdate,hiredate) * 30),0) from table
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文