Re: [SQL] Misnamed field in subquery does not cause error when field name exists in parent query

2007-12-24 Thread Rick Innis
On 22-Dec-07, at 7:14 PM, Michael Glaesemann wrote: It may be that SQL is doing exactly as it should, since 'id' is in scope within the subselect, but if that's the case it's a nasty gotcha. Yes, and yes. Ow. Thanks for confirming both my suspicions and my fears :-) R.

[SQL] Misnamed field in subquery does not cause error when field name exists in parent query

2007-12-22 Thread Rick Innis
Wondering if this is actually a bug, before I file a bug report on it. Consider this sequence: =# create table public.test1 (id int); CREATE TABLE =# create table public.test2 (it int); CREATE TABLE =# select * from test1 where id in (select id from test2); id (0 rows) Note that the sele