1UPDATE employee
2 SET staff_no =
3 CASE depno
4 WHEN 1 THEN 'ab123'
5 WHEN 2 THEN 'ab321'
6 --...
7 ELSE staff_no
8 END
9 WHERE depno IN ( 1, 2 ) -- list all cases here. use a subquery if you don't want to / cannot enumerate