I'm not a Teradata developer, but all DBMSes have severe problems rewriting Correlated Scalar Subqueries, that's why i always try to avoid them :-)
In your case i would a 3rd query, it's the easiest way to convert a scalar aggregate to a join:
Query 3:
sel a1,b1, totalamount
from t1 left join
(select a2, sum(c2) as totalamount
from t2
group by 1
) as dt
on a2=a1;
Btw, your Q2 should use an Outer Join, too, otherwise the result might be different.
I'm not a Teradata developer, but all DBMSes have severe problems rewriting Correlated Scalar Subqueries, that's why i always try to avoid them :-)
In your case i would a 3rd query, it's the easiest way to convert a scalar aggregate to a join:
Btw, your Q2 should use an Outer Join, too, otherwise the result might be different.