Given table:
Name | Date | Last Date | Frequency |
---|---|---|---|
Person1 | 1-Jan-2022 | 2-May-2022 | 30 Days |
Expected output:
Name | Updated Date | Some Other Column |
---|---|---|
Person1 | 1-Jan-2022 | Value 1 |
Person1 | 31-Jan-2022 | Value 2 |
Person1 | 2-Mar-2022 | Value 3 |
Person1 | 1-Apr-2022 | Value 4 |
Person1 | 1-May-2022 | Value 5 |
As shown above we have been given one record, ask is to create a new table from this record. We have to keep inserting new rows till "Updated Date"(Previous row Date + frequency days) in the expected table is less than "Last Date" in the given table.
I want to understand if there is a way to achieve this by Oracle SQL. (without PL/SQL).