반응형
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
set 내부에 상황에 대한 조건문을 case when 구문을 사용하여서 작성하였습니다
UPDATE
salary
SET
sex = CASE
WHEN sex = 'm' THEN 'f'
ELSE 'm'
END
반응형
'Database' 카테고리의 다른 글
LeetCode Department Highest Salary [ MySQL ] (0) | 2021.11.16 |
---|---|
LeetCode Delete Duplicate Emails [ MySQL ] (0) | 2021.11.01 |
[Mysql] Group By와 Having (0) | 2020.05.24 |
Mysql 한글 입력이 안될 때 해결법 (0) | 2020.04.10 |
Node.js Mysql 연결 오류 (0) | 2020.03.04 |