Not sure what is going on here and why this is not working. I'm receiving the following error:
"All expressions in a derived table must have an explicit name" - working with teradata.
select clm.c_clm
,clm.c_loc
from
(select *
from pearl_p.TLTC900_CLM clm) as cl
left join
(select
max(av.d_usr_udt_lst)
from pearl_p.TLTC913_AVY av
group by 1) as avy
on cl.i_sys_clm = avy.i_sys_clm
Your max(av.d_usr_udt_lst) in your subquery doesn't have an explicit name. You need to alias it like this:
max(av.d_usr_udt_lst) as "MaxThing"
So the query looks like
select clm.c_clm
,clm.c_loc
from
(select *
from pearl_p.TLTC900_CLM clm) as cl
left join
(select
max(av.d_usr_udt_lst) as "MaxThing"
from pearl_p.TLTC913_AVY av
group by 1) as avy
on cl.i_sys_clm = avy.i_sys_clm