Fredrik Karlsson wrote:
> 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?

Yes. Apart from a misplaced comma here and there, this statement should work.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to