📜  sql oracle 更新多行 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:07.454000             🧑  作者: Mango

代码示例1
UPDATE employee
   SET staff_no = 
           CASE depno
                WHEN 1 THEN 'ab123'
                WHEN 2 THEN 'ab321'
                --...
                ELSE staff_no
           END
 WHERE depno IN ( 1, 2 ) -- list all cases here. use a subquery if you don't want to / cannot enumerate