postgres 批量更新内容时间:2023-03-09 14:50:55 在程序中遇到这样的需求, 数据库表格式如下 需要把批量更新status, 如name = fox 时, status = 1, name = boa 时,status = 2 .... 类似的 postgres 的写法如下: update 表名 set status = case name when 'dodo' then '1' when 'eel' then '1' end where name in('dodo', 'eel');