Re: updating records in table A from selected records in table B

Поиск
Список
Период
Сортировка
От Maximilian Tyrtania
Тема Re: updating records in table A from selected records in table B
Дата
Msg-id AEF55947-7C17-4F9B-9ECD-0D4B8F910A49@contactking.de
обсуждение исходный текст
Ответ на updating records in table A from selected records in table B  (Robert Poor <rdpoor@gmail.com>)
Ответы Re: updating records in table A from selected records in table B  (Robert Poor <rdpoor@gmail.com>)
Список pgsql-novice
> ... is there a way to update quantity and cost fields in incumbents
> with the matching records from candidates?  It seems that UPDATE is
> designed only to update one record at a time...

Oh, no, it is certainly possible to do what you want here. The usual trick is:

UPDATE sometable set somefield=somevalue where id in (select id from somecomplicatedsubquery)

Maximilian Tyrtania Software-Entwicklung
Dessauer Str. 6-7
10969 Berlin
http://www.contactking.de


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

Предыдущее
От: Brent Dombrowski
Дата:
Сообщение: Re: pg_dumpall
Следующее
От: aaronenabs
Дата:
Сообщение: Re: pg_dumpall