Re: UPDATE with multiple WHERE conditions
От | Rob Sargent |
---|---|
Тема | Re: UPDATE with multiple WHERE conditions |
Дата | |
Msg-id | 2587edf4-cd3e-46bd-8203-2881fc3902e9@gmail.com обсуждение исходный текст |
Ответ на | Re: UPDATE with multiple WHERE conditions (Ron Johnson <ronljohnsonjr@gmail.com>) |
Ответы |
Re: UPDATE with multiple WHERE conditions
|
Список | pgsql-general |
On 6/12/24 15:48, Ron Johnson wrote:
Add "begin;" to that and try it. If you don't get exactly UPDATE 295 reported, then "rollback;";On Wed, Jun 12, 2024 at 5:28 PM Rich Shepard <rshepard@appl-ecosys.com> 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.
Is there a way to access a file with those condition values? If not, should
I create a temporary table with one column containing those values, or do I
write a psql script with 295 lines, one for each row to be updated?A plain UPDATE might work.UPDATE to_be_updated aSET bool_col = trueFROM other_table bAND b.field3 = mumble;(You can join them, right?)
В списке pgsql-general по дате отправления: