1.增加一秒钟
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+1/24/60/60 from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-14 00:00:01
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+ interval '1' second from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-14 00:00:01
2.增加一分钟
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+1/24/60 from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-14 00:01:00
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+ interval '1' minute from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-14 00:01:00
3.增加一小时
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+1/24 from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-14 01:00:00
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+ interval '1' hour from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-14 01:00:00
4.增加一天
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+1 from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-15 00:00:00
sec@ora10g> select to_date('20100514000000','yyyymmddhh24miss'),to_date('20100514000000','yyyymmddhh24miss')+ interval '1' day from dual;
TO_DATE('2010051400 TO_DATE('2010051400
------------------- -------------------
2010-05-14 00:00:00 2010-05-15 00:00:00
--转自