627.SWAP Salary
来源:互联网 发布:linux vi移到行尾 编辑:程序博客网 时间:2024/06/06 01:50
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 query and no intermediate temp table.
For example:
After running your query, the above salary table should have the following rows:
Answer1:
UPDATE salary SET sex=(IF(sex='f','m','f'));
Answer2:
UPDATE salary SET sex = CASE sex WHEN 'f' then 'm' ELSE 'f' END;
阅读全文
0 0
- 627. Swap Salary
- [leetcode]627. Swap Salary
- 627. Swap Salary
- 【LeetCode】627. Swap Salary
- 【leetcode】627. Swap Salary
- 627. Swap Salary
- 627. Swap Salary
- LeetCode-627. Swap Salary
- 627.SWAP Salary
- [LeetCode] 627.Swap Salary
- LC 627. Swap Salary
- sql leetcode 627. Swap Salary
- 627. Swap Salary--UPDATE and CASE...WHEN
- leetcode627. Swap Salary
- 【LeetCode】627、Swap Salary
- 8.leetCode627: Swap Salary
- LeetCode——627. Swap Salary(数据库,sql)
- 627. Swap Salary+编程中早晚用到的|、||、&、&&、异或、~、!运算
- 【SSLGZ 2793】2017年10月26日提高组T2 Deep(博弈)
- Django基本命令 静态文件配置 笔记
- codevs 1052 地鼠游戏 贪心
- 宿主机 Navicat 连接VMware Ubuntu 虚拟机 的MySQL 实现方法
- 第一天
- 627.SWAP Salary
- jsp一些知识点
- Leetcode算法学习日志-54 Spiral Matrix
- 在MAC上安装gnuplot
- gesture--Android手势的使用
- ACM-10月26驲周四周中训练心得
- 51nod 1204 Parity[并查集]
- R
- 递归的概念,阶乘, 斐波那契列数: