Generate Dates in oracle with gaps during Time Period

You can use the hiearchy query with simple logic as follows:

SELECT DATE '2020-01-01' + ( LEVEL * 5 ) - 1
  FROM DUAL CONNECT BY
    LEVEL <= ( DATE '2020-11-01' - DATE '2020-01-01' ) / 5;

Please note that in your question first two dates have 4 days of difference and in my solution, the First date will be 05-01-2020

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top