I'm stuck on this SQL problem.
I have a column that is a list of starting points (prevdoc
), and anther column that lists how many sequential numbers I need after the starting point (exdiff
).
For example, here are the first several rows:
prevdoc | exdiff
----------------
1 | 3
21 | 2
126 | 2
So I need an output to look something like:
2
3
4
22
23
127
128
I'm lost as to where even to start. Can anyone advise me on the SQL code for this solution?
Thanks!