I have this data
from which I need to print labels, so... I need to add another field to pair with QTY# and count up to QTY#, so 1 of 8, 2 of 8, 3 of 8 etc. I had thought of using something like row_number(), but wasn't sure of any nice way within SQL to do the expansion (Creating additional records). Thoughts?
Thanks,
Willie
Code:
P/N Version CageCode Customer JobDescription SO # PL # StockDescription SalesOrderLine PO # QTY# WO # BuildDate ITEM #
B332182-111 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 11 102612-00 1 331832 2015-06-29 ITEM 06
B332182-115 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 13 102612-00 1 331833 2015-06-29 ITEM 07
B332182-119 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 15 102612-00 1 331834 2015-06-29 ITEM 08
B332182-121 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 17 102612-00 2 331835 2015-06-29 ITEM 09
B332182-122 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 19 102612-00 2 331836 2015-06-29 ITEM 10
B332182-123 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 21 102612-00 1 331837 2015-06-29 ITEM 11
B332182-124 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 23 102612-00 1 331838 2015-06-29 ITEM 12
B332182-125 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 25 102612-00 8 331839 2015-06-29 ITEM 13
B332182-126 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 27 102612-00 8 331840 2015-06-29 ITEM 14
B332182-127 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46477 PL121525 CARPET, RECON, B777-200ER 29 102612-00 1 331841 2015-06-29 ITEM 15
B332182-129 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 1 102613-00 1 331842 2015-06-29 ITEM 01
B332182-131 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 3 102613-00 1 331843 2015-06-29 ITEM 02
B332182-133 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 5 102613-00 1 331844 2015-06-29 ITEM 03
B332182-135 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 7 102613-00 8 331845 2015-06-29 ITEM 04
B332182-137 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 9 102613-00 1 331846 2015-06-29 ITEM 05
B332182-138 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 11 102613-00 1 331847 2015-06-29 ITEM 06
B332182-139 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 13 102613-00 1 331848 2015-06-29 ITEM 07
B332182-141 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 15 102613-00 8 331849 2015-06-29 ITEM 08
B332182-143 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 17 102613-00 1 331850 2015-06-29 ITEM 09
B332182-145 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 19 102613-00 1 331851 2015-06-29 ITEM 10
B332182-147 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 21 102613-00 1 331852 2015-06-29 ITEM 11
B332182-149 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 23 102613-00 1 331853 2015-06-29 ITEM 12
B332182-151 - 6S626 FLIG01 CARPET, RECON, B777-200ER 46478 PL121526 CARPET, RECON, B777-200ER 25 102613-00 8 331854 2015-06-29 ITEM 13
from which I need to print labels, so... I need to add another field to pair with QTY# and count up to QTY#, so 1 of 8, 2 of 8, 3 of 8 etc. I had thought of using something like row_number(), but wasn't sure of any nice way within SQL to do the expansion (Creating additional records). Thoughts?
Thanks,
Willie