I am running a process on Spark which uses SQL for the most part. In one of the workflows I am getting the following error:
mismatched input 'from' expecting
The code is
select a.ACCOUNT_IDENTIFIER,a.LAN_CD, a.BEST_CARD_NUMBER,
decision_id,
case when a.BEST_CARD_NUMBER = 1 then 'Y' else 'N' end as best_card_excl_flag
from (select a.ACCOUNT_IDENTIFIER,a.LAN_CD, a. decision_id row_number()
over (partition by CUST_GRP_MBRP_ID
order by coalesce(BEST_CARD_RANK,999)) as BEST_CARD_NUMBER
from Accounts_Inclusions_Exclusions_Flagged a) a
I cannot figure out what the error is for the life of me
I've tried checking for comma errors or unexpected brackets but that doesn't seem to be the issue.