我试图在一个以游标为列的查询中设置where子句。
with w1 as (
select 1 pid, 'a1' pnm from dual union all
select 2 pid, 'b2' pnm from dual
), w2 as (
select 1 pid, 10 cid, 'aa1' cnm from dual union all
select 1 pid, 20 cid, 'bb2' cnm from dual union all
select 1 pid, 30 cid, 'cc3' cnm from dual union all
select 2 pid, 11 cid, 'dd4' cnm from dual union all
select 2 pid, 12 cid, 'ee5' cnm from dual
), w3 as (
select l.pid, l.pnm,
cursor(select d.cid, d.cnm from w2 d where d.pid = l.pid) a
from w1 l
)
select *
from w3
where a.cid = 11
这给了ORA-00904: "A"."CID": invalid identifier
甚至可以创建一个这样的where子句吗?
ver:Oracle 11gr2