with temp as (
select to_date('2020-01-01','yyyy-MM-dd') as starttime,to_date('2020-01-05','yyyy-MM-dd') as endtime from dual
union all
select to_date('2020-06-01','yyyy-MM-dd') as starttime,to_date('2020-06-02','yyyy-MM-dd') as endtime from dual
)
select rq from temp a join
(
select starttime+rownum-1 as rq from
(select min(starttime) as starttime,max(endtime) as endtime from temp)
connect by rownum<=endtime-starttime+1
) b on b.rq between a.starttime and a.endtime