Dear list,

Sorry for asking this SQL question, but I just have to make sure:

-  Aliases in subqueries - are the always, local to the scope of the subquery?


That is, if I have this query (this example makes _no_ sense, I know.
Just an illustration.):

select target.* from
(
    select target.* from
          (select m.id, n. name from mytable m, myothertable, n where
m.id = n.id) target,
          (select m.id, n. name from mytable m, myothertable, n where
m.id = n.id) comp1,
    where  target.id = comp1.id
) target,
mytable t
where  t.id = target.id;

will the aliases at the different levels be "safe" inside of their
subquery so that e.g. "target" in the outer query will be intact once
the subquery has been evaluated?

I am writing a query builder which has to work recursively, so I need
to make sure this is true.
Please tell me if this is not true.

/Fredrik


-- 
"Life is like a trumpet - if you don't put anything into it, you don't
get anything out of it."
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to