Re: Subselect with incorrect column not a syntax error?

Поиск
Список
Период
Сортировка
От Jack Christensen
Тема Re: Subselect with incorrect column not a syntax error?
Дата
Msg-id 4F886978.4080508@hylesanderson.edu
обсуждение исходный текст
Ответ на Subselect with incorrect column not a syntax error?  (Mike Blackwell <mike.blackwell@rrd.com>)
Ответы Re: Subselect with incorrect column not a syntax error?
Список pgsql-general
On 4/13/2012 11:39 AM, Mike Blackwell wrote:
> Could someone please explain to me why the following select does not
> result in a syntax error?  (9.0.3)
>
> begin;
>
> create table x( c1 integer , c2 integer);
> create table y( c3 integer, c4 integer);
>
> select * from x where c2 in ( select c2 from y where c4 = 2 );
>
>
> rollback;
>
> Mike
>
Your subquery is correlated with the outer query. So the c2 in the
subquery is referring to table x.

--
Jack Christensen
jackc@hylesanderson.edu


В списке pgsql-general по дате отправления:

Предыдущее
От: Mike Blackwell
Дата:
Сообщение: Subselect with incorrect column not a syntax error?
Следующее
От: Jeff Adams
Дата:
Сообщение: Re: Updating pg_attribute to change field's data type from integer to bigint on very large table