【leetcode系列】【SQL】【简单】交换工资

题目:

题目链接: https://leetcode-cn.com/problems/swap-salary/

解题思路:

mysql库函数if的应用

代码实现:

# Write your MySQL query statement below
update salary set sex = if(sex = 'f', 'm', 'f');
发布了138 篇原创文章 · 获赞 13 · 访问量 2458

猜你喜欢

转载自blog.csdn.net/songyuwen0808/article/details/105604464