I have a Decode statement that has a Select statement that gives me an Oracle error - ORA-00936: missing expression
When I run the Select statement by itself, it runs fine. Is it that I can't have a select statement like this below in a decode statement? Or do I need to change the logic or syntax for this to work?
"If the member is a 'minor' then I want to show the column - mem_formatted_name, else just show a null value instead..."
CASE WHEN DECODE(SELECT MINOR.MEM_FIRST_NAME
FROM TPA_REPORT.MEM_MEMBER MINOR,
WHERE MINOR.MEM_UID = PARENT.MEM_UID
AND MINOR.MEM_MEM_UID_POLICY_HOLDER = PARENT.MEM_UID, NULL, NULL, MINOR.MEM_FORMATTED_NAME)
WHEN pvt_provider_type = 'HCF' THEN Faculty.pvd_name
WHEN pvt_provider_type = 'PHY' THEN Doctor.pvd_name END MailToName