Leetcode 176 Second Highest Salary
2015-07-12 10:50
399 查看
Write a SQL query to get the second highest salary from the
For example, given the above Employee table, the second highest salary is
如果值不存在,max()返回NULL
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.
如果值不存在,max()返回NULL
select max(Salary) from Employee where Salary < (select max(Salary) from Employee)
相关文章推荐
- 创始人被踢出局,百度、淘宝、新浪上榜,谁更惨?
- 从总经理喝咖啡想到的一些事情,闲体制与个体
- 【Spark】RDD操作详解4——Action算子
- 大数据计算框架Hadoop, Spark和MPI
- 深入分析java i/o的工作机制学习笔记(随手笔记)
- 黑马程序员-学习日记(面向对象)
- Intent的使用
- c++中基本语法问题
- Ruby on Rails Tutorial 第五章 完善布局
- LightOJ 1215 Finding LCM(数论)
- svm用于多分类
- 关于UI的开发是使用代码还是Xib
- 编程的真正奥义在于,把人类的思维、设计、语言、逻辑和精神创造以一种计算机可以识别和储存的方式记录下来。
- ArrayList源码分析
- 面向对象设计原则之依赖倒置
- Hash表基本操作
- 并查集小结
- jquery.callback.js jq 回调
- ViewData与ViewBag
- 笔试——2015BAT实习招聘