本文介绍了如何在表格中获得第n个最高值...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张包含20条记录的表格,我想选择排名前5位的最高薪水,而不是前5行或第5条记录。



我尝试了什么:



i尝试了一些问题,但我没有得到预期的结果,所以请提前帮助我。

i have a table with 20 records in it, i want to select the top 5th highest salary in it not top 5 rows or 5th record.

What I have tried:

i have tried some quires but i didn't got the desired results so please help me thank you in advance.

推荐答案

在MySQL中的

> SELECT * FROM table ORDER BY hits DESC limit 5;


Oralce的



in Oralce

> SELECT * FROM table ORDER BY hits DESC where rownum <5;


这篇关于如何在表格中获得第n个最高值...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 03:54