>>>>> "bill" == bill wilson <bill.wilson.home@gmail.com> writes:
bill> This a toy example from a 'upsert' script that appends new data:bill> select a from (select 1 as a) as t1 where
notexists (selectbill> true from (select 2 as a) t2 where a=a) ;bill> abill> ───bill> (0 rows)
bill> Please tell me this a bug. We can see in the first querybill> without naming the tables that 'a=a' uses table t2
forbothbill> columns.
Of course it's not a bug. The column "a" in the inner scope hides the
column "a" in the outer scope, as explicitly required by the spec
(6.6 <identifier chain> in sql2008).
--
Andrew (irc:RhodiumToad)