Re: Update from select??

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Update from select??
Дата
Msg-id 20030703191645.GA24120@wolff.to
обсуждение исходный текст
Ответ на Update from select??  ("jose antonio leo" <jaleo8@storelandia.com>)
Список pgsql-general
On Thu, Jul 03, 2003 at 20:37:27 +0200,
  jose antonio leo <jaleo8@storelandia.com> wrote:
> Hi all,
>
> I need do a update from t1 set col='P' where int_art = (SELECT int_art from
> t2 ....).
> I know that thios sentence is not correct but I'd like do the update for
> everethigs rows that return the select.

You want something like:
update t1 set col = 'P' from t2 where t1.int_art = t2.int_art;

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

Предыдущее
От: psql-mail@freeuk.com
Дата:
Сообщение: Concatenating two Text fields from the same tuple
Следующее
От: "andy morrow"
Дата:
Сообщение: Re: problems with pg_restore to 7.3.3 db