176. Second Highest Salary
2016-05-23 10:02
330 查看
Write a SQL query to get the second highest salary from the
For example, given the above Employee table, the second highest salary is
is no second highest salary, then the query should return
# Write your MySQL query statement below
select MAX(Salary) as SecondHighestSalary from Employee
where Salary<(
select MAX(Salary)
from Employee);
Employeetable.
+----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +----+--------+
For example, given the above Employee table, the second highest salary is
200. If there
is no second highest salary, then the query should return
null.
# Write your MySQL query statement below
select MAX(Salary) as SecondHighestSalary from Employee
where Salary<(
select MAX(Salary)
from Employee);
相关文章推荐
- HDU 1085母函数模板题
- spring整合redis
- 马云一句话道出了穷人的真相:穷人为什么会穷!
- NotePad++ 6.92,改了些啥?
- 产品经理的一些碎想
- Binary Tree Inorder Traversal
- java学习的专题
- 设计模式 —— 观察者模式(Observer Pattern)
- 2016年JAVA程序员一定需要知道的优秀第三方库
- Gym 100947C- Rotate It !!
- Gradle build设置自动log开关
- iOS 创建Git 提交到GitHub 简明讲解配步骤图
- php单词里的大写字母
- 让你的:active好好工作
- C语言实现的RSA算法程序
- 图片按照px缩放切割功能
- Struts 2学习及问题记录(4)——拦截器机制
- 判断一个文件是否是指定后缀名的文件
- iOS开发~iOS9中iPad横屏时cell不正常显示
- JavaScript正则表达式上之基本语法(推荐)