I have the following table
TABLE A
ID | QUANTITY
------------
1 | 3
2 | 2
What I need is
TABLE B
ID | Ref No.
------------
1 | MyRef1
1 | MyRef2
1 | MyRef3
2 | AnotherRef1
2 | AnotherRef2
i.e. I need to generate Table B with the same number of rows as the quantity in A with an ascending ref no. on each row.
I can do it with cursors or UDFs but is there a more graceful solution?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…