Joined Tables are not allowed in FROM clause.

Database
Teradata Employee

Joined Tables are not allowed in FROM clause.

SyntaxEditor Code Snippet

 

Hi

 

I am running the below update statement in a store procedure and it give me error " SPL1027:E(L127), Missing/Invalid SQL statement'E(3706):Syntax error: Joined Tables are not allowed in FROM clause.'.

 

update
sas
from
DWD09V_APP_EHR_DBO.StyleAreaSeasonality sas
inner join
-- join with both active/inactive BDITEMS to get the DeptNo
DWD09C_EHR_IMPORT.BDITEMS b
on b.SectArea = sas.SectArea
and b.StyleRef = sas.StyleRef
--FROM
--DWD09C_EHR_IMPORT.BDITEMS b
inner join
 (select
         StyleRef, 
         SectArea, 
         GroupNo
   from DWD09C_EHR_IMPORT.STCCGRD
   group by
      StyleRef, 
      SectArea, 
      GroupNo
) 
sg
on sg.StyleRef = sas.StyleRef
and sg.SectArea = sas.SectArea,
DWD09V_APP_EHR_DBO.dimGroup G
set
   GroupID = g.dimGroupID
where
g.GroupNo = sg.GroupNo
and g.SectArea = sg.SectArea
and g.DeptNo = b.DeptNo
and v_date between g.SCDStartDate AND NVL(g.SCDEndDate, v_date) 
AND sas.SeasonalityRangeID = seasonalityID
and sas.GroupID <> g.dimGroupID; 

 

 

Any solution for this error ?

 

Thanks

Akshat