问题描述

解决方案

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
declare number int;
set number=N-1;
return (select distinct Salary from Employee order by Salary desc limit number,1);
END

177. Nth Highest Salary的更多相关文章

  1. 【SQL】177. Nth Highest Salary

    Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Sala ...

  2. LeetCode 177. Nth Highest Salary

    https://leetcode.com/problems/nth-highest-salary/description/ Write a SQL query to get the nth highe ...

  3. leetcode - database - 177. Nth Highest Salary (Oracle)

    题目链接:https://leetcode.com/problems/nth-highest-salary/description/ 题意:查询出表中工资第N高的值 思路: 1.先按照工资从高到低排序 ...

  4. [LeetCode] Nth Highest Salary 第N高薪水

    Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Sala ...

  5. leetcode Database3(Nth Highest Salary<—>Consecutive Numbers<—>Department Highest Salary)

    一.Nth Highest Salary Write a SQL query to get the nth highest salary from the Employee table. +----+ ...

  6. find the Nth highest salary(寻找第N高薪水)

    Suppose that you are given the following simple database table called Employee that has 2 columns na ...

  7. [SQL]LeetCode177. 第N高的薪水 | Nth Highest Salary

    Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Sala ...

  8. LeetCode——Nth Highest Salary

    Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Sala ...

  9. LeetCode - Nth Highest Salary

    题目大概意思是要求找出第n高的Salary,直接写一个Function.作为一个SQL新手我学到了1.SQL中Function的写法和变量的定义,取值.2.limit查询分    页的方法. 在这个题 ...

随机推荐

  1. mesos cluster

    http://spark.apache.org/docs/latest/running-on-mesos.html http://stackoverflow.com/questions/1993985 ...

  2. AndroidStudio项目import进的包都是红色的

    今天在开发项目时,一不留神,项目中import部分的内容全部变成了灰色,最后的类名却都变成了红色,如图: 一时之间,懵逼了~~~.Alt+Enter快捷键导包竟然是这个样子的@_@:  这简直就没见过 ...

  3. 201703 ABAP面试题002

    转自: ABAP 面试问题及答案(一):数据库更新及更改 SAP Standard (转) 问题一:锁对象(Lock Object)和 FM(Function Module)激活锁定对象时,产生的 F ...

  4. Java转C#,非常不错(转)

    http://www.cnblogs.com/cnwebman/archive/2012/07/21/2602436.html 最近正在研究将一个纯java工程如何转换成C#工程,代码量还比较大,于是 ...

  5. active scaffold

    模板文件路径:/.rvm/gems/ruby-2.2.3/gems/active_scaffold-3.5.3/app/views/active_scaffold_overrides

  6. pyhton3 os模块

    1 os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 2 os.chdir("dirname") 改变当前脚本工作目录:相当于shell下cd 3 o ...

  7. javascript重置(base层)(。。。。不完整)

    1.nextSibling浏览器兼容问题 <ul> <li id="item1"></li> <li id="item2&quo ...

  8. 【leetcode刷题笔记】Text Justification

    Given an array of words and a length L, format the text such that each line has exactly L characters ...

  9. Adding Flexcan driver support on Kernel

    Adding Flexcan driver support on Kernel On kernel menuconfig, add the following items: [*] Networkin ...

  10. python:列表的方法

    注意:在列表的类方法一般是没有返回值的,如果将处理过的列表给新变量,新变量是空类型.如:>>>a=[1,2]>>>b=a.append(3)>>> ...