public inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Rich Shepard <[email protected]>
Cc: [email protected]
Subject: Re: UPDATE with multiple WHERE conditions
Date: Thu, 13 Jun 2024 12:34:25 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwbzJwRLWVdLBKN4wyvAEmw+RzkRMXaMPrUHx0aZbRAU=w@mail.gmail.com>
On 2024-Jun-12, David G. Johnston wrote:
> On Wed, Jun 12, 2024 at 2:28 PM Rich Shepard <[email protected]>
> wrote:
>
> > I have a table with 3492 rows. I want to update a boolean column from
> > 'false' to 'true' for 295 rows based on the value of another column.
>
> I'll often just use a spreadsheet to build the 295 update commands and
> copy-paste them into psql or whatnot.
A closely related technique: if you have a query that generates the
UPDATE commands you need, you can run it under \gexec in psql, and
they'll be executed.
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Al principio era UNIX, y UNIX habló y dijo: "Hello world\n".
No dijo "Hello New Jersey\n", ni "Hello USA\n".
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: UPDATE with multiple WHERE conditions
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox