https://leetcode.com/problems/swap-salary/
Swap Salary - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
update Salary set sex = if (sex = 'm', 'f', 'm');
best
UPDATE Salary
SET sex = (CASE WHEN sex = 'm'
THEN 'f'
ELSE 'm'
END);
728x90
반응형
'자료구조 알고리즘 > 코딩테스트' 카테고리의 다른 글
1667. Fix Names in a Table (0) | 2022.05.30 |
---|---|
196. Delete Duplicate Emails (0) | 2022.05.30 |
1873. Calculate Special Bonus (0) | 2022.05.30 |
1137. N-th Tribonacci Number (0) | 2022.05.27 |
509. Fibonacci Number (0) | 2022.05.27 |