Update with subquery

Tools
Highlighted
N/A

Update with subquery

Is there a way using Teradata to update like in Oracle:

update GAM_EV
set hh_id =

(select b.hh_id
from GAM_EV a
left outer join
use_0511 b
on a.arng_id = b.arng_id
left outer join
ffw_0511 c
on b.hh_id = c.hh_id
where ind_flag EQ 1 )

where arng_id = a.arng_id

Any insights are appreciated as I'm new to Teradata.
1 REPLY
Enthusiast

Re: Update with subquery

Hi, The following is the equilavent Teradata query :

Update GAM_EV from (
Select b.hh_id
From GAM_EV a
Left Outer Join
use_0511 b
On a.arng_id = b.arng_id
Left Outer Join
ffw_0511 c
On b.hh_id = c.hh_id
Where ind_flag EQ 1 ) A
Set hh_id = A.hh_id
Where GAM_EV.arng_id = a.arng_id