Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generating dataset based on Start date and close date

Gor_MahiaNov 24 2025 — edited Nov 25 2025

All,
I am trying to generate the below dataset to either pass record as is or create extra records if the dates between START DATE & CLOSED DATE dates include 1st and 16th
i.e. if start date and close dates are in those ranges,

CREATE TABLE ACTIONS_TBL(ID NUMBER PRIMARY KEY, START_DATE DATE, CLOSE_DATE DATE)

original data:

Expected Output:

similar output:
-----------------------------------------------
1/16/2025 1/17/2025 --> 1 original record for 1/16/2025
3/5/2025 3/13/2025 --> 1 original record for 3/5/2025
4/24/2025 4/25/2025 --> 1 original record for 4/24/2025
10/14/2025 10/15/2025 --> 1 original record for 10/14/2025
6/4/2025 7/16/2025 --> 1 original record (6/4/2025) & 06/16, 07/01 records
4/22/2025 4/23/2025 --> 1 original record for 4/22/2025
11/2/2024 11/10/2024 --> 1 original record for 11/2/2024
12/9/2024 1/24/2025 --> 1 original record for 12/9/2024 & 12/16, 01/01, 01/16 records

Using Oracle Enterprise 19C.

Thanks in advance.

This post has been answered by mathguy on Nov 25 2025
Jump to Answer
Comments
Post Details
Added on Nov 24 2025
12 comments
343 views