Re: Error: Syntax error: expected something between '(' and the 'select' keyword.
There's good news and bad news :-)
The bad news: Teradata still doesn't support Scalar Subqueries within the SELECT list, yet (This will be implemented in TD13)
The good news: In most cases those Scalar Subqueries are easily rewritten as Outer Joins. But in your case there's a much better solution using Stabdard SQL OLAP functions: SUM(sq.a_pym_det) OVER (ORDER BY sq.d_bgn_pym_det ROWS UNBOUNDED PRECEDING) AS "RunningTotal"
Btw, the optimizer will replace those Left Joins with Inner Joins because it will be the same result.
Thus it might be rewritten as:
from BCPM_DDBO.VLTC916A_PYD a join BCPM_DDBO.vltc915a_pym b on a.i_sys_pym = b.i_sys_pym join BCPM_DDBO.vltc900a_clm c on b.i_sys_clm = c.i_sys_clm where c.c_pol not between 'LAC000001' and 'LAC0009999' and b.i_sys_clm = 36922