我使用的是 Oracle 10,但提出这个问题的最好方法是举个例子。
select *
from t1, t2
where t1.id = t2.id
and t1.otherID = (select max(otherID)
from t2
where id = THE ID FROM THE OUTER QUERY T1
)
我想你知道我想做什么。我需要t1
在子查询中引用以将其加入到t2
.
我需要知道如何创建这样的查询。
“来自外部查询 T1 的 ID”是我的困惑所在。
我尝试使用t1.id
,但没有得到结果。