Below I am trying to use a case statement and as soon as I add the arrowed line, I get this error.
ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
*Cause:
*Action:
Error at Line: 71 Column: 44
CASE
WHEN CUST200.TAX_NUMBER is null THEN 2
>>>> WHEN CUST200.TAX_NUMBER in ("I/C","BRANCH") THEN 1
WHEN CUST200.ACCOUNT_NUMBER in (8001,5201) THEN 1
ELSE 2
END "IC",
I have tried reformatting the line to other syntax like = ANY ("I/C","BRANCH") THEN 1 but get the same error. Even if I remove line "WHEN CUST200.TAX_NUMBER is null THEN 2" I still get the same error. However, "WHEN CUST200.TAX_NUMBER is null THEN 2" works fine if I remove the offending line.