Reference Address: http://wentao365.iteye.com/blog/779492
SELECT ' Current time ' TITLE, To_char (sysdate, ' yyyy-mm-dd hh24:mi:ss ') times from DUAL--the current time of the UNION all SELECT ' one minute before the first hour before the day before ' T
Itle, To_char (SYSDATE-1-1/24-1/24/60-1/24/60/60, ' yyyy-mm-dd hh24:mi:ss ') time From DUAL UNION all SELECT ' one minute ago ' TITLE, To_char (SYSDATE-1/24/60, ' Yyyy-mm-dd hh24:mi:ss ') from DUAL some time The time after 571 days is: Select To_date (' 2009-11-16 14:33:27 ', ' yyyy-mm-dd HH24:mi:ss ') + 571 from dual reference sysdate+ (5/24/60/60) at system time SYSDATE+5/24/60 delay of 5 seconds on the basis of the system time delay of 5 minutes sysdate+5/24 on the system time based on the delay of 5 hours sysdate+5 on the basis of the system time delay 5 days add_months (sysdate,-5) Delayed May add_months (sysdate,-5*12) on a system-time basis delay 5-year query based on system time 10 minutes ago Records Java Code Collection code select * from Sq_leavemessage m where s Ysdate-m.createtime<=10/60/24 1 days ago The product Java Code Collection code select Pv.create_time from Product_version PV where Roun D (To_number (sysdate-pv.create_time)) <=1 6-hour ago The product Java Code Collection code select Pv.create_time from Product_version PV Where round (To_number (sysdate-pv.cReate_time) *24) <=6 The product Java code collection created 1 minutes ago Select Pv.create_time from Product_version PV where round (to_number (sysdate-pv.create_time) *1440) <=1
<a target=_blank href= "http://blog.csdn.net/z69183787/article/details/22409771" style= "Text-decoration:none"; Color:rgb (0, 0, 0); Font-family: "Microsoft Yahei"; font-size:18px; Font-weight:bold; " >oracle sysdate time plus minus </a>
<p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > Addition </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select sysdate,add_months (sysdate,12) from dual; --plus 1 years </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; Padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select sysdate,add_months (sysdate,1) from dual; --plus January </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate+7, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 weeks </p> <p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0pX padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate+1, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 days </p> <p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate+1/24, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 hours </p><p Style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0pX padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate+1/24/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 minutes </p> <p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate+1/24/60/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --plus 1 seconds </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > Subtraction </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select sysdate,add_months (sysdate,-12) from dual; --minus 1 years </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, arial; font-size:14px; line-height:14px; " > select sysdate,add_months (sysdate,-1) from dual; --minus January </p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate-7, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --minus 1 weeks </p> <p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate-1, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --minus 1 days </p> <p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate-1/24, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --minus 1 hours </p><p Style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate-1/24/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual; --minus 1 minutes </p> <p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " ></p><p style= "margin-top:0px; margin-bottom:0px; padding-top:0px; padding-bottom:0px; Color:rgb (69, 69, 69); Font-family:tahoma, Helvetica, Arial; font-size:14px; line-height:14px; " > select Sysdate,to_char (sysdate-1/24/60/60, ' Yyyy-mm-dd HH24:MI:SS ') from dual;
--minus 1 seconds </p>