没有使用限制,让我获得第三高薪 [英] Get me 3rd highest salary with out using limit

查看:63
本文介绍了没有使用限制,让我获得第三高薪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在工资表中获得第三高薪

这是我的工资表...



NAME SALARY

NAME 120

KAILASH 350

MUNA 100

HARI 400



大喊大叫删除[/编辑]

How to get the 3rd highest salary in the salary table
It is my salary table...

NAME SALARY
NAME 120
KAILASH 350
MUNA 100
HARI 400

Shouting removed[/Edit]

推荐答案



试试这个,

Hi,
Try this one,
SELECT Name,Salary FROM (
  SELECT
    ROW_NUMBER() OVER (ORDER BY salary DESC) AS RowNumber, Name, Salary
  FROM yourTable
) AS Demo
WHERE RowNumber= 3





我希望这会有效。

谢谢:)



I hope this will work.
Thanks :)


在Mysql中你可以使用 limit

In Mysql you can use limit :
select * from tablename order by salary desc limit 1, 3


Select * From Employee E1 Where
    (N-1) = (Select Count(Distinct(E2.Salary)) From Employee E2 Where
		E2.Salary > E1.Salary)





点击这里了解更多......



Click Here to learn more...


这篇关于没有使用限制,让我获得第三高薪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆