Re-run on Oracle 8.1.7 with the corrected SQL:

select a, (select c from (select b + 1 as c from dual)) as d
from (select 1 as a, 2 as b from dual) 

ORA-00904: invalid column name

It did not like the 'select b' either.

--- Alexander Kozlovsky <[EMAIL PROTECTED]> wrote:

> Cory Nelson wrote:
> 
> > > Can anybody tell me, what is wrong with this simple query:
> > >
> > >    select a, (select c
> > >               from (select b + 1 as c) as Table2) as d
> > >    from (select 1 as a, 2 as b) as Table1
> >
> > I don't claim to be a master of SQL, but isn't "select b + 1 as c" its
> > own query, without access to the "2 as b" in the outer query?
> 
> But this query is work well:
> 
>     select a, (select b + 1 as c) as d
>     from (select 1 as a, 2 as b) as Table1
> 
> The problem is only with subqueries nested in another subquery.
> 
> 
> -- 
> Best regards,
>  Alexander                  mailto:[EMAIL PROTECTED]
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to