You can translate the question and the replies:

Can someone help me how to implement the below logic that uses sub query?

SELECT DISTINCT pd.PROJECT_ID, vuc.ID, vuc.NAME, vuc.PARENT_ID, ( SELECT DISTINCT CASE WHEN vuc.NODE_LEVEL=2 THEN 'null' WHEN vuc.NODE_LEVEL=3 THEN vuc.NAME WHEN vuc.NODE_LEVEL=4 THEN (select from unit_code mo where vuc.PARENT_ID) END FROM unit_code MO ) AS MANAGING_ORGANISATION, vuc.NODE_LEVEL, ( select from unit_code dvc where in (select mdvc.parent_id from unit_code mdvc where vuc.PARENT_ID AND vuc.NODE_LEVEL=4) OR vuc.PARENT_ID and vuc.NODE_LEVEL=3 OR vuc.ID and vuc.NODE_LEVEL=2 ) AS PORTFOLIO_OWNER FROM portfolio p, portfolio_member pm, unit_code vuc, deliverable pd WHERE p.PORTFOLIO_TYPE = 'Vested Unit' AND p.PORTFOLIO_ID = pm.portfolio_id AND p.PORTFOLIO_TYPENAME_ID = vuc.ID AND pm.MEMBER_TYPE = 'SMAP' AND pd.DELIVERABLE_ID = pm.MEMBER_KEY ORDER BY pd.PROJECT_ID
01-06-2021 05:13:28 -0400

1 Answer

Hi, subqueries cannot be included in the SELECT clause (as mentioned in the case below). [Subqueries cannot be included in a SELECT clause]( If you need more help and have a valid support account, you can open a new case in the Support Site so Denodo team can help you. Hope this helps!
Denodo Team
03-06-2021 05:20:15 -0400
You must sign in to add an answer. If you do not have an account, you can register here