176. Second Highest Salary
来源:互联网 发布:类似菠萝饭的软件 编辑:程序博客网 时间:2024/06/05 19:00
Write a SQL query to get the second highest salary from the Employee
table.
+----+--------+| 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
.
Subscribe to see which companies asked this question.
MySQL
# Write your MySQL query statement belowselect max(a.Salary) as SecondHighestSalaryfrom Employee a, ( select max(Salary) as Salary from Employee ) bwhere a.Salary < b.Salary;
0 0
- 176. Second Highest Salary
- 176. Second Highest Salary
- 176. Second Highest Salary
- 176. Second Highest Salary
- 176. Second Highest Salary
- 176. Second Highest Salary
- 176. Second Highest Salary
- leetcode 176. Second Highest Salary
- leetcode 176. Second Highest Salary
- leetcode.176. Second Highest Salary
- leetcode 176. Second Highest Salary
- Leetcode 176. Second Highest Salary
- 176. Second Highest Salary#1
- leetcode 176. Second Highest Salary
- leetcode 176. Second Highest Salary
- 176. Second Highest Salary(Leetcode)
- [理解leetcode解法]176. Second Highest Salary
- 【leetcode Database】176. Second Highest Salary
- html页面的meta标签的name和http-equiva区别
- 梁广轩_1505010601_实验3
- Android--百度API的初使用
- 静态方法和非静态方法的区别是什么
- 投掷硬币(动态规划)
- 176. Second Highest Salary
- VS2013出现“无法找到“xxx.exe”的调试信息,或者调试信息不匹配”错误解决方案
- 01背包问题
- C/C++:sizeof数组与指针
- erlang学习之自定义behaviour【转】
- java简单图书查找程序
- LeetCode 72. Edit Distance
- POJ 1056 immediately decodable (判断是否有前缀)
- 树的非递归遍历(很易懂)