第n大的薪水
来源:互联网 发布:mac怎么打开ps文件夹 编辑:程序博客网 时间:2024/04/29 00:58
Nth Highest Salary
Total Accepted: 710 Total Submissions: 5038My SubmissionsWrite a SQL query to get the nth highest salary from the Employee
table.
+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+
For example, given the above Employee table, the nth highest salary where n = 2 is 200
. If there is no nth highest salary, then the query should return null
.
解答:
create function getNthHighestSalary(N int)
returns INT
BEGIN
DECLARE M INT;
SET M=N-1;
RETURN(SELECT DISTINCT Salary from Employee order by Salary desc limit M,1);end
0 0
- 第n大的薪水
- MySQL查询每个部门的第N高薪水
- 查找第N大的数
- 寻找第n大的元素
- 集合的第N大元素
- 薪水高但压力大的槽要跳吗?
- 找出第n大元素
- 寻找一个序列中第n大的元素
- 一维数组, 第n大的数是多少?
- hdoj 求第n大的数运用STL priority
- 查找N个数中第K大的数
- 查找二叉查找树第N大的数
- N个数中第k大的元素
- 查找N个数中第K大的数
- 使用快排思想 求第n大的值
- 求一个整数数组中第N大的数
- leetcode177-Nth Highest Salary(找出第n大的数据)
- O(n)查找第k小(大)的数
- Android ActivityThread(主线程或UI线程)简介
- [CSS3教程]相对单位rem详解
- 定时任务:Java中Timer和TimerTask的使用
- android 编译boost动态库
- Unity——Export/Import Package功能和项目管理的研究
- 第n大的薪水
- iOS设计模式之观察者模式
- struts2环境搭建
- ContentProvider 内容提供者 共享数据
- Eclipse程序员要掌握的常用快捷键
- android开发过程中 R文件消失 clean 和 build project都无效 已解决
- poj3254--Fields+状态压缩dp
- 打印正弦余弦曲线
- activity配置属性:launchMode、taskAffinity