我正在尝试在 ORACLE DB 中运行查询,但由于以下错误“I.ID 无效标识符”一直失败。我想要做的是使用过滤器从嵌套查询中选择给定的结果,该过滤器应该使嵌套查询和上级查询相互关联。
The query is:
SELECT i.name, WOW.BI,WOW.BC, WOW.CP
from inv_investments i,
inner join (select
bi.COSTI BI,
bc.COSTI BC,
cp.COSTI AS CP
FROM
(select atom.COSTI from
(select odf.IF_CST_TOT COSTI
from prj_baselines bl
inner join odf_ca_baseline odf on odf.id = bl.id
WHERE i.id = bl.project_id
ORDER BY bl.created_date DESC) atom where rownum =1) cp,
(select odf.IF_CST_TOT COSTI
from prj_baselines bl
inner join odf_ca_baseline odf on odf.id = bl.id
where odf.if_budget = 1
AND i.id = bl.project_id) bi,
(select odf.IF_CST_TOT COSTI
from prj_baselines bl
inner join odf_ca_baseline odf on odf.id = bl.id
Where if_budget_corrente = 1
AND i.id = bl.project_id) bc ) WOW on wow.ID = i.ID
你知道如何解决吗?每次我检查嵌套查询的 where 子句(例如 WHERE i.id = bl.project_id)时,我都会收到错误消息...