Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 12 Nov 2003 @ 23:57:55 GMT


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


Subj:   Re: Aggregation in UPDATE statement
 
From:   Jason Fortenberry

Just apply the same Oracle derived table logic, just a little different syntax form for Teradata:

UPDATE table1
FROM (SELECT field_name, SUM(val) as field_value FROM table2 GROUP BY field_name) D1
SET val = D1.field_value
WHERE table1.field_name = D1.field_name

--Jason



     
  <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