gpt4 book ai didi

plsql - PL/SQL中的DateAdd函数

转载 作者:行者123 更新时间:2023-12-04 22:25:13 25 4
gpt4 key购买 nike

如标题所示,我正在pl/sql中寻找一个函数,该函数的功能类似于DateAdd函数。
我一直在寻找,我发现了add_months函数,但是我真的想要一个可变的函数,因为我需要能够增加分钟,小时,天等。

最佳答案

似乎解决方案不多:

PL/SQL allows you to perform arithmetic operations directly on date variables. You may add numbers to a date or subtract numbers from a date. To move a date one day in the future, simply add 1 to the date as shown below:


hire_date + 1

You can even add a fractional value to a date. For example, adding 1/24 to a date adds an hour to the time component of that value. Adding 1/(24*60) adds a single minute to the time component, and so on.

关于plsql - PL/SQL中的DateAdd函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4012938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com