1、 日、月、年的加减
select
sysdate as 当前日期,
sysdate - 8 as 减8日,
sysdate + 8 as 加8日,
add_months(sysdate, -8) as 减8个月,
add_months(sysdate, 8) as 加8个月,
add_months(sysdate, -8 * 12) as 减8年,
add_months(sysdate, 8 * 12)as 加8年
from dual;
2、 时、分、秒的加减
select
sysdate as 当前日期,
sysdate - 8 / 24 as 减8小时,
sysdate + 8 / 24 as 加8小时,
sysdate + 8 / 24/ 60 as 减8分钟,
sysdate + 8 / 24/ 60 as 加8分钟,
sysdate + 8 / 24/ 60/ 60 as 减8秒,
sysdate + 8 / 24/ 60/ 60 as 加8秒
from dual;
3、 日期间隔(时、分、秒)
select
tmp.dates as 间隔天数,
tmp.dates * 24 as 间隔小数,
tmp.dates * 24 * 60 as 间隔分钟,
tmp.dates * 24 * 60 *