曹耘豪的博客

MySQL之Set-Case

1
2
3
4
5
6
7
8
9
10
11
UPDATE t_name
SET
a = case
when type = '4' then null
else a
END,
b = case
when type = '4' then null
else b
END,
WHERE id = 1
   / 
  ,