Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 15 Mar 2006 @ 22:27:21 GMT


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


Subj:   Re: AUTO_NUMBER in Teradata
 
From:   Wayne Schachtel

try something like this -

     insert into table (col1, col2, . . .)
     select vt.max_id + row_number() over(order by ' ') surrogate_key, . .

      from source_table a
      cross join
            (select coalesce(max(surrogate_key),0) max_id
               from target_table) VT

Wayne Schachtel
Wayne Schachtel Consulting



     
  <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