about 10 years ago
There are two ways to fetch Nth highest salary/number.
1 - By using general sql query which works on all database.
2 - By using database specific sql query.
Database specific sql query example Nth highest salary/number
SQL Queries in Oracle to fetch Nth highest salary/number.
select min(salary) from (select * from (select * from
SQL Queries in SQL Server to fetch Nth highest salary/number.
select min(SALARY) from (select top N * from
SQL Queries in MySQL to fetch Nth highest salary/number.
select min(SALARY) from (select * from
General sql query to fetch Nth highest salary/number.
SELECT DISTINCT salary FROM emp X WHERE n =
( SELECT COUNT(DISTINCT salary) FROM
Replace n with the required number to fetch Nth highest salary. for example to get the 3rd highest salary replace n= 3.
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2023 FindNerd.com. All rights reserved.
Sign up using