Below is an excerpt from my sql code, I am trying to return a string 'Off-Campus' if the value from select statement is null. If the value is not null, I want to return the value itself. However, I am getting an error:ORA-00904: "SITE_DESC": invalid identifier 00904. 00000 - "%s: invalid identifier"
Please advice on how I can go about this.
WHEN 'S' THEN (
case when(SELECT
site_desc
FROM
building
WHERE
site_code = (
SELECT
code
FROM
table2
WHERE
name = 'code'
)
) is null then 'Off-Campus' else site_desc end
)
WHEN 'F' THEN (
.... ...... .......
)