Simple query but unable to find the syntax error

Analytics
Enthusiast

Simple query but unable to find the syntax error

I have edited the below query by addign the case statements in bolf but its giving me a syntax error,

3706: Syntax error: expected something between the word 'STAT' and '.'.

Can any one locate the issue with teh query

REPLACE VIEW xyz.xxxxx

AS LOCKING ROW FOR ACCESS

SELECT

STAT.MI_MOF_GRP_NUM

,STAT.MMS_GSTAT_DATE

,STAT.EFF_STA_DTE

,STAT.CCY_NET_BAL

,STAT.STG_NET_BAL

,STAT.CCY_NET_FEE_BAL

,CASE

WHEN MGRP.MONITORTYPE = 4

THEN

CASE

WHEN STAT.AGGREGATELIMIT = 99999999999.00

THEN 9999999999.00

ELSE STAT.AGGREGATELIMIT

END

ELSE

CASE

WHEN STAT.NET_LIMIT = 99999999999.00

THEN 9999999999.00

ELSE STAT.NET_LIMIT

END

END AS NET_LIMIT
,STAT.CCY_GROSS_BAL

,STAT.STG_GROSS_BAL

,CASE

WHEN STAT.GROSS_LIMIT = 99999999999.00

THEN 9999999999.00

ELSE STAT.GROSS_LIMIT

END AS STAT.GROSS_LIMIT


,STAT.MMS_STAT_CHANGED

,CASE

WHEN STAT.AGGREGATELIMIT = 99999999999.00

THEN 9999999999.00

ELSE STAT.AGGREGATELIMIT

END AS STAT.AGGREGATELIMIT


,STAT.CCYAGGBAL

,STAT.STGAGGBAL

,STAT.CCYSODAGGBAL

,STAT.STGSODAGGBAL

,STAT.SODBALDTE

,STAT.CCYSODNETBAL

,STAT.STGSODNETBAL

,STAT.CCYSODGROSSBAL

,STAT.STGSODGROSSBAL

,STAT.EFF_END_DTE

,STAT.DW_LOD_TMP

FROM

abc.def STAT

INNER JOIN

ghi.jkl MGRP

ON STAT.MI_MOF_GRP_NUM = MGRP.MI_MOF_GRP_NUM

;
1 REPLY
Enthusiast

Re: Simple query but unable to find the syntax error

Sorry, it was a silly mistake on my part,
had added the table alias along with the column after the end case.