sql Server 中add函数到 oracle date add的 *** 作
oracle date add minutes
How does one add a day/hour/minute/second to a date value?
submitted by admin on Wed,2004-08-04 14:16 The SYSDATE pseudo-column shows the current system date and time. Adding 1 to SYSDATE will advance the date by 1 day. Use fractions to add hours,minutes or seconds to the date. Look at these examples:
sql> select sysdate,sysdate+1/24,sysdate +1/1440,sysdate + 1/86400 from dual;
SYSDATE SYSDATE+1/24 SYSDATE+1/1440 SYSDATE+1/86400
-------------------- -------------------- -------------------- --------------------
03-Jul-2002 08:32:12 03-Jul-2002 09:32:12 03-Jul-2002 08:33:12 03-Jul-2002 08:32:13
The following format is frequently used with Oracle Replication:
select sysdate Now,sysdate+30/(24*60*60) Now_PLUS_30_SECS from dual;
Now Now_PLUS_30_SECS
-------------------- --------------------
03-Jul-2005 16:47:23 03-Jul-2005 16:47:53
Here are a couple of examples:
Description Date Expression
Now SYSDATE
Tomorow/ next day SYSDATE + 1
Seven days from Now SYSDATE + 7
One hour from Now SYSDATE + 1/24
Three hours from Now SYSDATE + 3/24
An half hour from Now SYSDATE + 1/48
10 minutes from Now SYSDATE + 10/1440
30 seconds from Now SYSDATE + 30/86400
Tomorrow at 12 mIDnight Trunc(SYSDATE + 1)
Tomorrow at 8 AM Trunc(SYSDATE + 1) + 8/24
Next Monday at 12:00 noon NEXT_DAY(Trunc(SYSDATE),'MONDAY') + 12/24
First day of the month at 12 mIDnight Trunc(LAST_DAY(SYSDATE ) + 1)
The next Monday,Wednesday or FrIDay at 9 a.m Trunc(LEAST(NEXT_DAY(sysdate,''MONDAY' ' ),NEXT_DAY(sysdate,''WednESDAY''),''FRIDAY'' ))) + (9/24)
以上是内存溢出为你收集整理的SQL Server 中add函数到 oracle date add的 *** 作全部内容,希望文章能够帮你解决SQL Server 中add函数到 oracle date add的 *** 作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)