How inside a nested select to refer to tables defined outside the nested select?
Posted on 2007-07-25
How is it possible to referer to tables that are defined in the FROM clause, which is outside the scope of a nested select. Here is an example:
FROM (SELECT COUNT(t1.C0)
FROM table1 AS t1
WHERE t1.C1 = ***t2.C1***) subquery,
table2 AS t2
the thing designated with stars is what Oracle does not like. But it is perfectly legitimate in Postgresql or SQL Server.
Is there a way around it? completely rewriting the query using inner joins, etc. is not a solution in my case. The query really ought to have the structure of a nested select.