I need help from the community, I have a table that has the following information:
| Date | Number of Months | Value |
|---|---|---|
| 2019-01-01 | 1 | 7 |
| 2019-01-01 | 3 | 5 |
| 2019-02-01 | 2 | 9 |
Depending on the number of months, I need to replicate this for the following months and have an output like this:
| Date | Number of Months | Value |
|---|---|---|
| 2019-01-01 | 1 | 7 |
| 2019-01-01 | 3 | 5 |
| 2019-02-01 | 3 | 5 |
| 2019-03-01 | 3 | 5 |
| 2019-02-01 | 2 | 9 |
| 2019-03-01 | 2 | 9 |
How can I achieve this with SQL on Teradata?
You can use Teradata's
EXPAND ONsyntax: