Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Tue, 19 Feb 2008 @ 21:02:02 GMT

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

Subj:   Re: SQL to populate additional data
From:   Pinti, Michele A

How about inserting the results of:

     select n.product, n.new_Expanded_product
     from (select product, substr(Expanded_product,1,3) ||
     cast(day_of_calendar - 1as char(1)) new_Expanded_product
         from prod_table
        cross join
         (select * from sys_calendar.calendar where day_of_calendar < 11) cal
        where product like '%X' ) n
     left join prod_table
     on substr(n.product,1,3) = substr(prod_table.product,1,3)
     and n.new_Expanded_product = prod_table.Expanded_product
     where prod_table.product is null

WOW! I got this to work. Thanks for the help. I wouldn't have gotten this on my own.

  <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: 28 Jun 2020