Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Update for Derive Tables - response (1) by M.Saeed Khurram

$
0
0

Hi,
I have checked you statement with a sample scenario and it is working fine. The following query should work for you.
I have made just a little change, you were refering the COL55 by qualifying with T1, which I think is incorrect. because T1 is the alias of inner table of the derived TGT. Everything else looks fine. 

UPDATE TGT
FROM 
( 
SELECT
COL1, COL2, COL3, COL4 
FROM TABLE_1 T1
INNER JOIN TABLE_2 T2 ON T1.ID = T2.ID
INNER JOIN TABLE_3 T3 ON T2.ID = T3.ID
) TGT ,
(
SELECT
COL1, COL2, COL3, COL4 
FROM TABLE_4 T4
INNER JOIN TABLE_5 T5 ON T4.ID = T5.ID
INNER JOIN TABLE_6 T6 ON T5.ID = T6.ID
) LRY
SET  COL55 = 33
WHERE  LRY.COL1 = TGT.COL1

Further can you please tell details of the actual error you are facing?
 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>