其他分享
首页 > 其他分享> > Leetcode学习笔记:#627. Swap Salary

Leetcode学习笔记:#627. Swap Salary

作者:互联网

Leetcode学习笔记:#627. Swap Salary

Given a table salary, such as the one below, that has m=male and f=female values. 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 temp table.

Note that you must write a single update statement, DO NOT write any select statement for this problem.

实现:

UPDATE salary SET sex = IF(sex = 'm', 'f', 'm')

标签:Salary,627,sex,single,values,Swap,statement
来源: https://blog.csdn.net/ccystewart/article/details/90178667