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
Write an SQL query to swap all 'f' and 'm' values (i.e., change all 'f' values to 'm' and vice versa) with a single update statement and no intermediate temporary tables.
풀이
제출한 답
UPDATE SALARY
SET SEX = CASE WHEN SEX = 'F' THEN 'M'
ELSE 'F' END
'데이터 분석 > SQL 연습문제' 카테고리의 다른 글
Top Earners (HackerRank) (0) | 2022.09.17 |
---|---|
196. Delete Duplicate Emails (LeetCode) (0) | 2022.09.16 |
코테 연습 26일차 (프로그래머스 SQL 고득점 Kit) (0) | 2022.03.09 |
코테 연습 25일차 (프로그래머스 SQL 고득점 Kit) (0) | 2022.03.08 |
코테 연습 24일차 (프로그래머스 SQL 고득점 Kit) (0) | 2022.03.07 |
댓글