0 - 3 of 3 tags for 3706 error

Hello All,
 
I am new to Teradata. I encountered a weird error and I am not sure about the cause of this error. I am trying to build a view using some select statement. Pasted below is the select statement -
 

I am troubling over this error as I am not sure what the cause might be. Any help would be greatly appreciated.

select Id, (select
case
when Fall_score = b.MaxScore then 'Fall'
when Spring_score = b.MaxScore then 'Spring'
from sandbox.testtable t where t.Id = b.Id
) as MaxScoreCategory,MaxScore
from (select Id, max(Score) as MaxScore
from (select Id, 'Fall', Fall_score from sandbox.testtable union all
select Id, 'Spring', Spring_score from sandbox.testtable)
a (Id, Category, Score)

Hi, I have a simple SQL where I am trying to create a table using a select statement, I have no idea why this is bumping me out. The select by itself is working and returning rows successfully. Please help.

This is the SQL -

create table dbc.tb2 as
(select
Rcrd_No,
compltn_dt,
substr(compltn_dt,1,position(' ' in compltn_dt )) as dt,
trim(substr(compltn_dt,position(' ' in compltn_dt )+1,characters(compltn_dt)))as ts,
Trim(case when position ('/' in dt) = 2 then 0||substring(dt,1,1) else substr(dt,1,2) end) as mth,