--- Alexander Kozlovsky <[EMAIL PROTECTED]> 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 > 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.
Does these queries work on other databases? Are they valid correlated subqueries? Some other variations to ponder: sqlite> CREATE TABLE bogus(x,y,z); -- empty sqlite> select a, (select b + 1 as c from bogus) as d from (select 1 as a, 2 as b) as Table1; a d ---------- ---------- 1 sqlite> select a, (select b + 1 as c from (select 5 as x, 6 as y, 7 as z)) as d from (select 1 as a, 2 as b) as Table1; a d ---------- ---------- 1 3 Shouldn't these two queries produce the same results? __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

