一次更新 table 的几列

update several columns of a table at once

在 postgresql 中,我想根据它们的 id 更新 table 的几行。这不起作用:

    UPDATE table SET othertable_id = 5 WHERE id = 2, 45, 22, 75

正确的语法是什么?

使用 IN operator:

update the_table
  set othertable_id = 5
where id in (2,45,22,75);