Dear Group,
Teradata Version: V2R5
I have been trying to solve this problem for more than a day and everytime I get differenty error.
I want to update a certain table with count(*) of another table if certain condition is true, else update with 0.
This is the portion I have problem with,
SELECT col1, col2, col3,
CASE WHEN t1.col1 > t1.col2 then (select count(*) from T2
where t1.key = t2.key and t2.dt between
<startdate> and <enddate>)
ELSE 0
END new_val from T1 where ...
My update would be something like,
update table set coln = <above case>
Thanks,
Da
Teradata Version: V2R5
I have been trying to solve this problem for more than a day and everytime I get differenty error.
I want to update a certain table with count(*) of another table if certain condition is true, else update with 0.
This is the portion I have problem with,
SELECT col1, col2, col3,
CASE WHEN t1.col1 > t1.col2 then (select count(*) from T2
where t1.key = t2.key and t2.dt between
<startdate> and <enddate>)
ELSE 0
END new_val from T1 where ...
My update would be something like,
update table set coln = <above case>
Thanks,
Da