Nth Highest Salary
来源:互联网 发布:淘宝模特拍摄的业务 编辑:程序博客网 时间:2024/06/05 00:10
Write a SQL query to get the nth highest salary from theEmployee
table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+
For example, given the above Employee table, the nth highest salary wheren = 2 is 200
. If there is no nth highest salary, then the query should returnnull
.
题意:找出表中工资第n高的
order by,limit 及变量的使用
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INTBEGIN declare m int; set m = n - 1; RETURN ( # Write your MySQL query statement below. select distinct salary from Employee order by salary desc limit m, 1 );END
0 0
- LeetCode Nth Highest Salary
- Nth Highest Salary
- Nth Highest Salary
- 177 - Nth Highest Salary
- Nth Highest Salary
- Nth Highest Salary
- MySQL-Nth Highest Salary
- 177. Nth Highest Salary
- Leetcode177. Nth Highest Salary
- 【LeetCode】Second Highest Salary && Nth Highest Salary
- LeetCode | Second Highest Salary & Nth highest salary
- leetcode 177 Nth Highest Salary
- LeetCode_OJ【177】Nth Highest Salary
- leetcode 177. Nth Highest Salary
- leetcode.177. Nth Highest Salary
- leetcode 177. Nth Highest Salary
- Leetcode 177. Nth Highest Salary
- [LeetCode]Nth Highest Salary,解题报告
- android webview设置自适应任意大小的pc网页
- float double diff
- 集合collections(Arrays,aList,toArray) 高级for循环 可变参数 静态导入
- 常用类型数据的字节数和表示的范围
- codeforce 439D 二分或者三分
- Nth Highest Salary
- LeetCode算法题之String to Integer (atoi)
- poj 3286
- Xargs用法详解
- MySQL general_log优化性能
- 鼠标悬浮图片上,显示上传按钮,点击实现预览功能,支持多浏览器
- JAVA笔记
- 时间日月季类
- java 中方法重载和方法覆盖的却别