Re: Something I'd like to try...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Something I'd like to try...
Дата
Msg-id 29636.970599821@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Something I'd like to try...  (Barry Lind <barry@xythos.com>)
Список pgsql-sql
Barry Lind <barry@xythos.com> writes:
> I have a table that stores a hierarchy.  Sometimes in an update I want
> to join back to the same table to get other information related to
> children or parent rows.  In Oracle I can do this using the alias, but
> in Postgresql I cannot.

> update table_foo f1
> set column_b = 1
> where exists (select column_a from table_foo f2
>                   where f2.parent_foo_id = f1.foo_id);

What's wrong with the spec-compliant

update table_foo
set column_b = 1
where exists (select column_a from table_foo f2             where f2.parent_foo_id = table_foo.foo_id);

?
        regards, tom lane


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

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: Something I'd like to try...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: OID Perfomance - Object-Relational databases