题目:https://leetcode-cn.com/problems/swap-salary/
代码:
# Write your MySQL query statement below
update salary set sex =
(case sex when "m" then 'f' else 'm' end)
注意:
考察update的使用和case when语句。
update 表名 set 字段 =
case when sex ="m" then 'f' else 'm' end
也可以。