| Archives of the TeradataForumMessage Posted: Tue, 03 Sep 2002 @ 16:55:20 GMT
 
 
  
| Subj: |  | Re: Splitting records depending on Qty |  |  |  | From: |  | Buckland |  
 The way that I would do that would be to create a separate table, SEQ_TBL (could be a temporary table), that contains a single column:
SEQ_NBR.  The data in the table would be a series of sequence numbers up to the highest that are likely to be needed. Then the query would be something like this 
SELECT *
FROM ITEM_TBL A
   ,SEQ_TBL B
WHERE A.ITEMQTY <= B.SEQ_NBR
;
 This would give you a product join constrained by the ITEMQTY column.  I'm not sure it would be terribly efficient, but for a small job
it should work. Mike Buckland 
 
 |