Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 31 Mar 2006 @ 11:33:34 GMT


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


Subj:   Re: SAME TABLE UPDATE
 
From:   Krause, Andreas

You should write the statement in follwing way:

     update b
     FROM PRODDSS_DEV.POITOUSE b
     set ORD_QTY = b.DLV_QTY
     WHERE PO_NBR = b.PO_NBR
     and ITM_NBR = b.ITM_NBR
     and ENTR_DT = b.ENTR_DT

b specifies a correlation name.

Here a small explanation about the correlation name from the Teradata SQL-Reference:

If you specify a correlation name for table_name_1 in the FROM clause, then you must specify that correlation name for the updated table instead of table_name_1.

A correlation name must be specified for at least one of the tables in a selfjoin operation.

If you specify a correlation name for table_name_1 in the table_name_2 table list using the joined tables syntax, then you must specify that correlation name instead of the true name for table_name_1.


Regards

Andreas Krause



     
  <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