문제
풀이
- write an sql query to swap all
f
and m
values with a single update statement and no intermediate emp table(s).
- note that you must write a single update statement, do not write any select statement for this problem.
- the query result format is in the following example.
코드
UPDATE Salary
SET sex = CASE WHEN sex = 'm' THEN 'f' ELSE 'm' END
결과
출처 && 깃허브
leetcode
github