获取近10天的日期列表:
//10替换成需要的天数N
select to_char(trunc(sysdate)-level,'YYYY-MM-DD') from dual connect by rownum<=10;
# 获取今天起未来10天的日期列表
select to_char(trunc(sysdate-1)+level,'YYYY-MM-DD') from dual connect by rownum<=10;
查询结果如下:
//10替换成需要的天数N
select to_char(trunc(sysdate)-level,'YYYY-MM-DD') from dual connect by rownum<=10;
# 获取今天起未来10天的日期列表
select to_char(trunc(sysdate-1)+level,'YYYY-MM-DD') from dual connect by rownum<=10;
查询结果如下: