Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Feb 2008 @ 17:59:57 GMT


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


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

Hi again Michele:

Without V2R6 and as you indicate, no desire for an intermediate table, you might do something like this since you only want 9 more rows (bonus - no export/import required):

     ins into prod
     sel product, cast((cast(expanded_product as byteint)+1(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+2(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+3(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+4(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+5(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+6(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+7(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+8(format '9999')) as
     char(4)) from prod where product like '%x'
     UNION ALL
     sel product, cast((cast(expanded_product as byteint)+9(format '9999')) as
     char(4)) from prod where product like '%x'

Regards,

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: 27 Dec 2016