Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Feb 2008 @ 14:42:46 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: SQL to populate additional data
 
From:   Michael Larkins

If I understand your requirements correctly and didn't want to use a table to generate rows, I would use the original table and a recursive derived table, something like this:

     with recursive temp (a2, b2,lvl) as
     (sel max(a), max(b),0 from numtest
     union all
     sel a2+1,b2+1,1 from temp
     where a2 < 100)
     ins into t1 sel a2, b2  from temp where lvl > 0

Of course this is predicated on having V2R6.


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023