Re: Update from select

Поиск
Список
Период
Сортировка
От Vincent Veyron
Тема Re: Update from select
Дата
Msg-id 1368478282.2563.54.camel@asus-1001PX.home
обсуждение исходный текст
Ответ на Update from select  (Bret Stern <bret_stern@machinemanagement.com>)
Список pgsql-general
Le lundi 13 mai 2013 à 13:23 -0700, Bret Stern a écrit :
> PG 8.4
>
> Having trouble putting together an update query to update
> multiple columns in tbl1 from columns in tbl2.
>
> update tbl1
> set col3,col4,col5
> from
> (select col3, col4,col5 from tbl2 where col1="criteria")
>

UPDATE tbl1
SET col3=t2.col3, col4=t2.col4, col5=t2.col5
FROM tbl2 t2 WHERE t2.col1="criteria"


--
Salutations, Vincent Veyron
http://gdlc.fr/logiciels
Applications de gestion des sinistres assurance et des contentieux juridiques



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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: refactoring a database owner without "reassign owned"
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: refactoring a database owner without "reassign owned"