在程序中遇到這樣的需求, 數據庫表格式如下

需要把批量更新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');
