Re: updating records in table A from selected records in table B - Mailing list pgsql-novice

From Maximilian Tyrtania
Subject Re: updating records in table A from selected records in table B
Date
Msg-id AEF55947-7C17-4F9B-9ECD-0D4B8F910A49@contactking.de
Whole thread Raw
In response to updating records in table A from selected records in table B  (Robert Poor <rdpoor@gmail.com>)
Responses Re: updating records in table A from selected records in table B  (Robert Poor <rdpoor@gmail.com>)
List 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 by date:

Previous
From: Brent Dombrowski
Date:
Subject: Re: pg_dumpall
Next
From: aaronenabs
Date:
Subject: Re: pg_dumpall