nth highest salary in sql

Solutions on MaxInterview for nth highest salary in sql by the best coders in the world

showing results for - "nth highest salary in sql"
Lara
12 Jun 2016
1SELECT TOP 1 salary
2FROM (
3SELECT DISTINCT TOP N salary
4FROM #Employee
5ORDER BY salary DESC
6) AS temp
7ORDER BY salary
Laura
30 Nov 2019
1Here is the solution for nth highest
2salary from employees table 
3
4SELECT FIRST_NAME , SALARY FROM 
5(SELECT FIRST_NAME, SALARY, DENSE_RANK() OVER
6(ORDER BY SALARY DESC) AS SALARY_RANK
7FROM EMPLOYEES)
8WHERE SALARY_RANK = n; 
Zahra
09 Jun 2018
1SELECT MAX(SALARY) 'SECOND_MAX' FROM EMPLOYEES
2WHERE SALARY <> (SELECT MAX(SALARY) FROM EMPLOYEES);
3
4
5OR
6
7Here is the solution for nth highest
8salary from employees table 
9
10SELECT FIRST_NAME , SALARY FROM 
11(SELECT FIRST_NAME, SALARY, DENSE_RANK() OVER
12(ORDER BY SALARY DESC) AS SALARY_RANK
13FROM EMPLOYEES)
14WHERE SALARY_RANK = n; 
Antonio
21 Nov 2016
1Here is the solution for 3rd highest
2salary from employees table 
3
4SELECT FIRST_NAME , SALARY FROM 
5(SELECT FIRST_NAME, SALARY, DENSE_RANK() OVER
6(ORDER BY SALARY DESC) AS SALARY_RANK
7FROM EMPLOYEES)
8WHERE SALARY_RANK = 3; 
Jessa
28 Jan 2019
1SELECT first-name
2FROM employees
3WHERE salary = (SELECT MAX(salary) FROM employees);
Claudio
20 Oct 2018
1SELECT MIN(EmpSalary) from ( 
2	SELECT EmpSalary from Employee ORDER BY EmpSalary DESC LIMIT 3 
3);
queries leading to this page
mysql query to find nth highest salaryget second most highest salary sqlhow to find 3rd highest salary oehr in sqlfind nth highest salary in sqlquery to find 2nd largest salary in sqlmax salary in nth sqlfirst max salary in sqlnth highest salary in sql serverhow to calculate the second highest salary in sqlget second highest record in sqlemployee second highest salary in sqlselect 3rd highest salary in sqlhow to get third highest salary in sqlhow to 3rd maximum salary in sql queryhow many ways to get 3rd highest salary in sqlhow to get the second highest salary in sqlsecond largest salary sql2 highest salary in sqlselect the nth largest record in sql qeury5 highest salary in sqlsecond highest salary sql using limit2nd highest salary in sql using limitfind second highest salary using limit in sqlthird highest salary in sql using rownumnth highest salary in mssqlhighest salary in sqlsql queries to find nth highest salarysql query for 3rd highest salaryfind 5th highest salary in sqlhow to get the third highest salary orm in sqlsql highest salaryhighest lowest salary sqlhow to get a second highest salary in sqlget highest salary in sqlsecond highest salary employee sqlselect third max salary in sqlhow to find second largest salary in sqlfind the person with 2nd highest salary sqlthird highest salary in sql using tophow to find highest salary in sql3rd maximum salary in sqlsecond highest salary in sqlsecond highest salary in sql using limit2nd largest salary in sqlhow to find 2nd highest salary in sql3rd highest salary in sql find second maximum salary in sqlfind nth highest salary in sql serverfind the thirt hiegest salry in sqlhow do you 2nd highest salary in sqlget nth largest salary sqlhow to find top 2 salary in sqlsecond highest salary insqlhow to give find second highest salary in sqlfinding second highest salary in sqlnth highest salaryfind second highest salary sqlgetting 4th highest salary in sqlsql server 3rd highest salarysql query to find the nth highest salarylist the highest salary in sqlsql query 3 highest salarydetermine the 5th highest salary without using top or limit method for workerdisplay the nth highest salary drawing employee details mysql2nd highest salary sql querysql query to find 5th highest salaryselect 5th highest salary in sql serverthird largest salary in sqlhow to get 4th highest salary in sqlfind nth max salary in sql serverhow to find third highest salary in sqlsecond highest salary my sqlhow would you find the 10th highest employee salary in the employee table 3fsql query nth highest salarynth highest salary in sql query2nd height salary sql5th highest salary sql server querysql second highest salary of employee3rd highest salary from employee table sql querygetting n max salary in sqlselect distinct 28salary 29 from table order by salary desc limit n 2c12nd max salary query in sqlsql query for finding nth highest salary7th highest salary in sqlq how to get the second highest salary using sql 3fselect highest salary from table in sqlfind out third highest salary in sqlsql highest ntsql query to find nth highest salary using limitsecond highest salary query in sqlcalculate 3rd highest salary sqlnth highest salary in sql without limithow to find the tenth highest salary in sqlsql query to retrieve fifth highest salarysql query to find nth highest salary of employeesql select highest salaryhow to get nth number in sqlfind nth highest record in sqlsql select highst salary2nd highest salary in sql practicequery to get nth highest salaryhow to select top 3 salary in last 30 daysquery for 5th highest salary in sql without using top or limit method in sqlhighest salary in sql queryfind 4th highest salary in sqlsecond minimum salary in sql geeksforgeekshow to find the second highest salary in sqlselect second highest salary in sqlfind the nth highest salary in sqlhow to print 2nd and 3rd highest salary in sqlhighest nth salary in sqlsecond highest salary in sql querytable row number 6 highest salaryquery for 5th highest salary in sql without using top or limit method find 5 max salary sqlsecend highest salary sql queryfind nth higest salary in sqlsql query kth highest salary get second highest salary of a particular department sqlmysql nth highest salarysql command to find nth highest salarysecond highest salary code 3a find 5th largest salary in a given salary table query for 2nd highest salary in sqlwrite an sql query to determine the 5th highest salary without using top or limit methodtop second highest salary in sqlms sql find nth highest salarysecond highest salary from salary colun sql commandget second highest salary in sql9th max salary from sqlselect 4 highest salary in sqlwrite a query to determine the nth 28say n 3d5 29 highest purch amt from orders table select 5th highest salary in sqlhow to get 2nd highest salary in sqlhow to find last 2nd highest salary in sqlquery for 5th highest salary in sql without using top or limit methodsql query to find the second highest salaryhow to second highest salary in sqlsecond most highest salary in sqlfind 3rd max salary in sql using limitsql query highest salaryhow to find the third highest salary in sqlsql query for second largest salarygive second highest salary in sqlfind nth highest salary in sql with ctesecond nth highest salary in sqlfind second largest salary in sql3 highest salary in sqlthird hightest sql logicn highest salary in sql in big query salary from worker order by salary desc limit n 1 2c1 3b how this workshow to calculate second max salary in sql3rd largest salary in sql2nd and 3rd highest salary in sqltop 10 max salary query in sqlhow to find the second maximum salary in sqlfinding the third highest salary in sqlfind max salary in sqlsql 3rd highest salaryget nth salary sql serverhow to get second highest salary using limit in sqlsql problem to find nth highest salaryhow to find nth highest salary in sqlsql queries for highest salaryselect nth highest salary in sql serverfind nth largest salary in sqlsql select nth highest salarysql query 5th highest salaryfifth highest salary in sqlthird highest salary in sql using limitselect the 3rd highest salary sqlwrite a sql query to find the second highest salary from employees table how to get highest salary in sql serverhighest second salary in sql using limit2nd maximum salary in sql serversecons hiest salary in sql without limitfind the second highest salary in sqlfind highest salary in sql4 highest salary in sql4th maximum salary using subquery in mysqlsql query to get second highest salarymax 3rd salary sqln highest salary in mysql using correlated subquery3rd highest salary in sql using limitselect third highest salary in sqldisplay 3rd highest salary in sqlhow to find the 2nd highest salary in sql serverlowest salary in sqlthird highest or second highest salary querynth highest salary mysqlhighest salary query in sqlnth salary in sqlsql second highest salarysecond highest salary in teradatasql get 3rd highest salaryhow to select nth highest salary in sqln m sqlselect 2nd highest salary in sqlnth highest salary in sqlget kth largest element sql dense rankget max salary fro employee in sqlhighest second salary in sqlsql query to find the second highest salary of employee 3f5th maximum salary sqlfind third max salary in sqlsecond highest salary in sql sqhow to select highest salary in sqlwrite an sql query to find the nth highest salary from table5th highest salary sql write an sql query to determine the 5th highest salary without using top or limit method 14th highest salary sqlhow to find out 2nd highest salary in sqlkth largest salary in sql order bygetting 3rd highest salary sql3rd highest salary in sql using join10th highest salary in sqlwrite a sql query to get the nth highest salary from the employee table find the 2nd highest salary in sqlsql server employee highest salary by departmentwrite a sql query to get the third highest salary of an employee from employee table 3fnth highest salary sql querysql command to find second highest salaryget 3rd highest salary in sqlselect 3rd highest salary in sql practicewrite a query to find the nth highest salary from the table without using top 2flimit keyword get nth highest salary in sqlhow to find nth highest salary in sql 3f3 largest salary in sql4th highest salary in sql using limithow to only get the highest salary in sqlwrite a query to get third highest value oracledetermine the 5th highest salary without using top or limit method second highest from sqlthirdhighest salary in sqlhow to find the second highest number in sqlselect the 5 th highest salary in sqlfind the 2nd max salary in sqlsql third highest valuehow to display second highest salary in sqlsecond largest salary in sqlsql find second highest salarytop 3rd salary in mysqlnth highest salary in sql with explanationhow to find 10th highest salary in postgresqlretrive the 5th heighest salary in sqlnth largest number sql queryto find nth highest salary in sqlquery to find 5th highest salary in sqlsecond highest salary sql querymax 3 salary in sqlhow to find second max salary in sqlselect second highest salary in sql without using limithow to get 5th highest salary in sql serversql get third highest salarywrite a query to return top 5th record of an employee based on salary given all required columns are present in same tableselect second highest salary sql problem online3rd highest salary in sqlsql query for 1st highest salarysql select get 3rd highest salaryhow to find 3rd highest salary in sqluse limit in mysql to find nth highest salarysql query to find out highest salary from thenth highest salary in sqlfind 2nd highest salary in sqlselect 3rd max salary in sqlfind second highest salary in sqlsql find the nth highest salaryfind the 2nd largest salary in sqlhow to get fifth highest salary in sqlfind nth max salary in sqlthird max salary in sqlwrite a query to find the 4th maximum salary in the employees tablesql query second highest salarysecond highest salary sqlsql query on finding the second highest salary from the employee table how to find 5th highest from sqlhow to find out the third highest salary in sqlquery to find nth highest salary in sqlsql query for nth highest salaryhow to findout third max salary form tablewrite an sql query to determine nth the highest salarysql to find the nth highest salary2nd max salary in sql3rd max salaary sql4th highest salary in sqlhow to get nth max salary in sqlprint fourth highest salary in sqlhow to get 3rd highest salary in sqlmax 4th salary from employe tablemysql query to get second highest salarydquery display 5 th highest salaryget top 3 highest salary in sql without window functionwrite a query to find nth highest salaryfind first maximum salary sqlin sql find nth highest salaryhow to highest salary in sqlget the second highest salary in sqlget 2nd highest salary in sqlsql query for highest salarysql qury to get the second highest salarynth highest salary in oraclesql query to find 2nd highest salaryfind third highest salary in sql serverselect esal from emp order by esal desc limit 1 2c1get n highest salary sqlsql query to find second highest salaryhighest salary sql queryfinding highest salary in sqlfind third highest salary in sql5th highest salary in sql serverquery for second highest salaryfind nth highest salary in sql using limithow to get the nth highest salary in sqlhow to find the 2nd highest salary in sqlfinf the 3rd highest salary using sqlmysql third highest salarywrite a sql query to print highest salary in 3 consecutive yearswith the highest salaries sqlsql server nth highest salaryhow to get second highest salary in sql2nd highest salary in each department sqln highest salary in mysqlsql query to find the person with the third highest salarydetermine the 5th highest salary without using top or limit method2nd highest salary in sqltop 2nd highest salary in sqlget third highest salary in sqlnth highest salary in each department sql serverhow to get highest salary in sqlsecond maximum salary in sqlsql query for 2nd highest salaryfind n highest salary in sqlhow to find 3nd highest salary in sqlsql query to find details of highest salaryfind 3rd maximum salary in sqlhow to find the 3rd highest salary in sql3rd highest salary in sql serverselect the highest salary in sql queryget nth max salary sqlsecond highest salary fastestfind the highest salary in sqlsql for nth highest salaryhow to fetch third highest salary in sqlquery to select the 5th largest salary from the employee tableprint second highest salary in sqlhow to 2nd highest salary in sqlhow to get nth highest salary in sqlsql query to find 3rd highest salarysecond largest salary sql by maxn max salary in sqlfind 3rd highest salary in sqlsql to find third highest salary3rd height salary sqlget the 3rd highest salary sqlhow to select third highest salary in sqln highest salary in sqlhow to nth highest salary in sqlselect highest salary in sqlnth highest salary in sql by limitwhat is the query for second highest salary in sqlhow to select 3rd highest salary in sqlnth highest salary in sql limit4th maximum salary using subquerysql query to find highest salaryfind 2nd highest salary in sql using rownumwrite an sql query to find the nth highest salary from table sql query to fetch 3rd highest salaryorder by second highest salary in sqlhow to get the third highest salary in sqlfind 3 highest salary sqlgetting nth highest salary sql using limitsql to find second highest salarydisplay third highest salary in sqlgetting nth highest salary sqlnth highest salary in mysqlsecond max salary in sqlfind out the highest salary in sqlset the nth highest salary in sqlhow to get the 2nd highest salary in sql4th maximum salary in sqlcalculate nth highest salary sqlfind second highest salary in sql using limitmax second salary sqlsql query to find out nth highest salaryhow to know the 4th highest salary in sqlsql query to find nth largest salarysql third highest salarysql query to find n highest salarythird highest salary in sqlselect 3 max salary in sqlsecond highest salary querywrite sql query to get third highest salary from employee table5th highest salary in sqlsql server 2nd highest salarynth highest salary queryhow to find third max salary in sqlsql query to find out the second highest salary select nth highest salary in sqlhow to find second highest salary in sqlsql 2nd highest salarynth highest salary in sql using ctefind the third highest salary in sqlmax salary in sqlsecond highest salary in sql server3rd higest sql querysql query to find nth highest salaryeasiest way to find nth highest salarywrite a query to find third highest salary in sql3rd max salary in sqlhow to find out 3rd highest salary in sqlwrite an sql query to find the nth highest salary from table ans 2c using top keyword 28sql server 29 2nd hioghest salary using rank functionselect second highest salary in sql with other datasql nth highest salary where salary is givenwrite an sql query to determine the 5th highest salary without using top or limit method sql query for second highest salary3rd highest salary sql querywrite a sql query to get the second highest salary from employee tablehighest 2nd salary in sqlfind the n highest salary in sqlselect nth max salary in sqlfind maximum salary in sqlhow to get second highest salary using sqlhow to get 2nd and rd highest salary in sqlsecond highest salary in sql using rankhow to find max salary in sqlnth minimum salary in sqlselect max salary in sqlselect 5th highest salary in mysqlfind 2nd rank in sqlthird highest salary sqlget second highest salary in sql using ctenth max salary in sqlsecond highest salary in sql using rownumsql 4th highest salerysql query to find second highest salary of employeenth highest salary in ms sql serversql nth highest salaryget kth largest element sqlcreate a sql function to return nth highest salarynth highest salary sqlhow to find 10th highest salary in sqlfourth highest salary in sqlnth highest salary in sql