Is there any SQL syntax using netezza SQL, given column number, trying to generate rows for number in decreasing order down to 0.
Below is an example of what I'm trying to do
BEFORE
| ID | NUMBER |
|---|---|
| A | 4 |
| B | 5 |
AFTER
| ID | NUMBER |
|---|---|
| A | 4 |
| A | 3 |
| A | 2 |
| A | 1 |
| B | 5 |
| B | 4 |
| B | 3 |
| B | 2 |
| B | 1 |
please also click to see screenshot for example thanks
You can use the
_v_vector_idxtable for this purposeHere's the example in action