Oracle使用SQL语句获取起止时间内所有日期:
SELECT
to_date('2018-08-01 00:00:00','YYYY-MM-DD HH24:MI:SS')+level-1 as dates
FROM
dual
CONNECT BY
level <= to_date('2018-08-08 00:00:00','YYYY-MM-DD HH24:MI:SS')-to_date('2018-08-01 00:00:00','YYYY-MM-DD HH24:MI:SS')+1;
运行结果: