I have a table with two columns; EVENT_DATE date
and RANG number
the first column holds a date for an event while the second column is for the period of that event. here is a sample of data
| EVENT_DATE | RANG |
|------------|------|
| 03/01/2015 | 1 |
| 09/04/2015 | 3 |
| 15/10/2015 | 2 |
is there any way to expand the EVENT_DATE
by increment it based on the RANG
value, so the output will be like,
| EVENT_DATE |
|------------|
| 03/01/2015 |
| 04/01/2015 |
| 09/04/2015 |
| 10/04/2015 |
| 11/04/2015 |
| 12/04/2015 |
| 15/10/2015 |
| 16/10/2015 |
| 17/10/2015 |
Best Answer
You could use a CTE to get a table with a sequence of numbers up to the highest rank in your table, and then join with that: