Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 04 Feb 2004 @ 22:29:29 GMT


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


Subj:   Re: UPDATE and OUTER JOIN
 
From:   Swarnapuri, Vinod

  Babu : "Is it possible to post the DDL and SQL? Are you updating a view or table? If view , is it a JOIN view or a simple view?"  



Hi Babu,

For security reasons, I will not be able to post the actual query. But I can assure you that the query is very similar to the query that you have posted.

I am updating a table.

UPDATE TABLE1 a
FROM
(       SELECT  COALESCE(b.key_field, c.key_field) As drv_key_field,
                        COALESCE(b.new_field, c.new_field) AS drv_new_field
        FROM TABLE2 c
        LEFT OUTER JOIN TABLE3 b
        ON c.key_field  = b.key_field) drv

SET      new_field = drv_new_field
WHERE drv.key_field = a.key_field;

Regards,

Vinod Swarnapuri



     
  <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