【发布时间】:2012-02-15 09:19:26
【问题描述】:
从 oracle 10g 迁移到 11g 时,我有一个存储过程,其语法如下:
select * from table1
union
select t,y from
(select * from table2)aliasQuery
where t=aliasQuery.t
该查询在 10g 上运行良好,但 11g 返回一个错误,即未定义 aliasQuery。
也许 11g 不再支持这种语法,或者缺少一些数据库配置?
编辑
完整的查询是:
select *
from table1
union
select t, y
from ( select *
from table2 ) aliasQuery
where ( select max(t)
from ( select t
from table3
where table3.t = aliasQuery.t)
)>10
【问题讨论】:
-
此语法在 11g 中运行良好。你说它是存储过程的一部分,你能提供所有的代码吗?另外,你能提供返回的确切错误吗?
-
select * from table1 union select t,y from (select * from table2)aliasQuery where (select max(t)from (select t from table 3 where table3.t=aliasQuery.t)跨度>
-
错误:无效标识符 aliasQuery.t
-
@Hadad,我已将您发布的查询添加到问题中。如您所见,
where中没有条件是没有意义的。你确定这是正确的吗? -
当然有条件,但我错过了,我会更新问题
标签: sql oracle oracle10g oracle11g