SELECT TO_CHAR(sdt + LEVEL * 2 - 2, 'yyyy-mm-dd') || ' 19:00' sdt , CASE WHEN sdt + LEVEL * 2 - 1 <= edt THEN TO_CHAR(sdt + LEVEL * 2 - 1, 'yyyy-mm-dd') || ' 07:00' END edt FROM (SELECT TO_DATE('2022-01-01', 'yyyy-mm-dd') sdt , TO_DATE('2022-01-05', 'yyyy-mm-dd') edt FROM dual ) CONNECT BY LEVEL <= CEIL((edt - sdt + 1) / 2) ;