n highest salary in sql

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

showing results for - "n highest salary in sql"
Iyed
20 Nov 2016
1SELECT TOP 1 salary
2FROM (
3SELECT DISTINCT TOP N salary
4FROM #Employee
5ORDER BY salary DESC
6) AS temp
7ORDER BY salary
Diego
10 Jan 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; 
Eleonora
02 May 2016
1SELECT salary FROM Employee ORDER BY salary DESC LIMIT N-1, 1
queries leading to this page
get 6th largest in sqlnth highest salary sqlhow to select highest salary in sqlsecond highest salary sql queryfind highest salary in sqlhighest salary query in sql4th maximum salary using subquery in mysqlwrite a query to determine the nth 28say n 3d5 29 highest purch amt from orders table nth highest salary mysqlget 2nd highest salary in sqlwrite a sql query to print highest salary in 3 consecutive years4th maximum salary using subqueryget second highest record in sqlhow to give find second highest salary in sql2nd hioghest salary using rank functionfind the highest salary in sqlfind nth highest salary of an employeehow to find out 2nd highest salary in sqlselect 10th highest salary sqlget 3rd highest salary in sqlhow to find the third highest salary in sqlsql query 5th highest salaryselect nth highest salary in sqlsecond largest salary sql by maxnth highest salary in sqlhow to find 3rd highest salary oehr in sqlsecond highest from sqlsql query second highest salaryfind 2nd highest salary in sqlget second most highest salary sqlhow to get third highest salary in sqltop second highest salary in sql3rd max salary in sqlhow to calculate second max salary in sqlsql query to find second highest salary of employeen highest salary in sqlwhat is the query for second highest salary in sqlorder by second highest salary in sqlhow to select top 3 salary in last 30 daysdisplay the nth highest salary drawing employee details mysqlhow to find the 2nd highest salary in sql serversql query to get second highest salarysecond most highest salary in sqlmysql query to get second highest salaryselect 5th highest salary in sql servern highest salary in mysql using correlated subqueryselect second highest salary sql problem onlinewrite a sql query to get the third highest salary of an employee from employee table 3fsecond highest salary from salary colun sql command2nd highest salary in sql using limitsecond highest salary employee sqlhow to get second highest salary using sqlmax 3 salary in sqlhow to find highest salary in sqlselect distinct 28salary 29 from table order by salary desc limit n 2c1third highest salary in sql using rownumgiven an employee table 2c find the e id and e name of the employee with the third highest salary2nd max salary query in sqlselect the highest salary in sql querynth salary in sql serverfind the third highest salary in sqlsql query to find the person with the third highest salaryfind out third highest salary in sqlhow to highest salary in sqlsecons hiest salary in sql without limitcorrelated subquery to find nth highest salarythird hightest sql logicselect n highest salary in sqlsql query to find 3rd highest salaryhow to calculate the second highest salary in sqlsql query for third highest salaryhow to get a second highest salary in sqlsql highest salaryfind nth highest record in sqleasiest way to find nth highest salaryquery for second highest salaryfind second largest salary in sqlsecond highest salary in sql querymysql nth highest salarysql query for second highest salarysql command to find second highest salaryselect third max salary in sqlselect 5th highest salary in mysqlrite a sql query to get the nth highest salary from the employee table give second highest salary in sqlnth highest salaryemployee second highest salary in sqln m sqlfind the thirt hiegest salry in sqlwrite a sql query to find the second highest salary from employees table find the 2nd max salary in sqlwrite a query to get third highest value oraclewrite a sql query to get the nth highest salary from the employee table list the highest salary in sql3rd highest salary sql queryget the 3rd highest salary sqlget top 3 highest salary in sql without window functionhighest salary sql querygetting 3rd highest salary sql2nd highest salary in each department sqlhow to find last 2nd highest salary in sqlhow to get 4th highest salary in sqlsql problem to find nth highest salaryfind second highest salary in sqlget second highest salary in sqlsql query kth highest salary get n highest salary sqlselect highest salary in sqlhow to find 2nd highest salary in sqlsecond highest salary in sql using limithow to get 2nd highest salary in sqldetermine the 5th highest salary without using top or limit method fifth highest salary in sqlsql query to find the second highest salarythird highest salary in sqlwrite a query to return top 5th record of an employee based on salary given all required columns are present in same tabletop 3rd salary in mysql2nd and 3rd highest salary in sqlquery to select the 5th largest salary from the employee tablefind 2nd highest salary in sql using rownumsecond highest salary in sqlsql query for nth highest salary3rd height salary sqlnth largest number sql queryhow to find out 3rd highest salary in sqln max salary in sqlhow to find the tenth highest salary in sqlhow to get highest salary in sqltop 2nd highest salary in sqlfinding second highest salary in sqlfind out the highest salary in sqlhighest 2nd salary in sqlselect second highest salary in sql without using limitfind the person with 2nd highest salary sqlhow to second highest salary in sqlsql query to find n highest salarymax salary in sql3rd highest salary in sqlfind the n highest salary in sqlhow to find the second maximum salary in sqlfind third max salary in sqlsecond max salary in sqlhow to find the 3rd highest salary in sqlsql 4th highest saleryfind 4th highest salary in sqlsql query for 2nd highest salarykth largest salary in sql write an sql query to determine the 5th highest salary without using top or limit method sql query to find out highest salary from thehow to select 3rd highest salary in sqlsql query highest salarysecond highest salary querythird highest or second highest salary querysql to find second highest salaryhow to find the second highest number in sqlhow to find third highest salary in sqlsecond highest salary in teradatafind second maximum salary in sqlwrite a sql query to get the second highest salary from employee tablen highest salary in sql in big query finding the third highest salary in sql5th highest salary sql server queryget highest salary in sqlsql nth highest salary2nd highest salary in sqlhow to find second highest salary in sqldquery display 5 th highest salaryhow to nth highest salary in sqlfind 2nd rank in sqlhow to find 5th highest from sqlmax 4th salary from employe tablehow to find the 2nd highest salary in sqlsecend highest salary sql queryhow to find 3rd highest salary in sql5th maximum salary sqlfind second highest salary in sql using limit 3a find 5th largest salary in a given salary table write a sql query to find employee with third highest salary 2c without using top or inner query10th highest salary in sqlfind 5th highest salary in sqlsql query for second largest salaryget kth largest element sql dense rank3rd highest salary in sqlsql queries for highest salaryhow to get 3rd highest salary in sqlsql highest ntselect second highest salary in sql with other data14th highest salary sqlsecond highest salary codefourth highest salary in sqlget second highest salary of a particular department sqlsecond highest salary insqlsecond highest salary in sql serversql find second highest salary2nd max salary in sqlsecond highest salary fastestsecond largest salary in sqlsql server 2nd highest salarysql query to find 2nd highest salarynth highest salary in sql server3 highest salary in sqlhow to find highest average in sqlsecond highest salary in sql using rankselect the 5 th highest salary in sqlsql query on finding the second highest salary from the employee table sql to find third highest salarythird highest salary sqlquery to find 2nd largest salary in sqlnth maximum salary in sqlfind 3rd maximum salary in sqlhow to get second highest salary using limit in sqlselect second highest salary in sqlselect top 2nd highest salary for sqlget nth salary sql serverfind the 2nd largest salary in sqlfind the nth highest salary in sqlhighest second salary in sql using limitfinding nth highest salary in sqlsql get 3rd highest salarysql query to find the second highest salary of employee 3ffind n highest salary in sqlsecond highest salary sql4th highest salary in sql using limitfind nth max salary in sqln highest salary in mysqlselect 2nd highest salary in sql4 highest salary in sqlfind the 2nd highest salary in sqlquery to find 5th highest salary in sqlhow to find fifth s highest salary in sqlsecond maximum salary in sql3rd salary in sql select 3rd highest salary in sqlfind third highest salary in sql serverhighest lowest salary sqlcalculate 3rd highest salary sqlnth highest salary in sql using correlated subquerysecond highest salary query in sqlselect 5th highest salary in sqlsql select highest salarynth highest salary sql query2nd largest salary in sqlsecond highest salary in sql using maxsql query to find out the second highest salary write a query to find the 4th maximum salary in the employees tablehow to get 2nd and rd highest salary in sqlgetting 4th highest salary in sqlget third highest salary in sqlget kth largest element sqlselect nth highest salary3rd highest salary in sql serverthird max salary in sqlhow to find nth salary in sqlsql second highest salary of employeesql query to find second highest salarysecond largest salary sqlhow to find nth highest salary in sqlfind 3rd highest salary in sqlsecond nth highest salary in sqlkth largest salary in sql order byhighest nth salary in sqlhow to find second largest salary in sqlhow to find 10th highest salary in sqln highest salary sqlhow to display second highest salary in sqlfind nth highest salary in sqlhow to find second max salary in sqlget second highest salary in sql using ctehow to print nth highest salary in sqlhow to 2nd highest salary in sqlquery to find nth highest salarysql qury to get the second highest salaryfirst max salary in sql4th maximum salary in sqlhighest salary in sqlhow to only get the highest salary in sqlhow to get fifth highest salary in sql sql query to display 2nd highest salaried employee details and may ask for nth highestnth highest salary in mysqlsql 3rd highest salaryq how to get the second highest salary using sql 3fsql query to find highest salarylowest salary in sql4th highest salary in sqlwrite a query to find nth highest salaryhow to get second highest salary in sqlhow to get the 2nd highest salary in sqlhow would you find the 10th highest employee salary in the employee table 3fwrite a sql query to find the 4th maximum element from a table2nd maximum salary in sql server9th max salary from sqlsql query to find details of highest salaryhow to find nth highest salarysql third highest salaryprint second highest salary in sqlnth highest salary in sql using ctesql second highest salaryhow to get highest salary in sql serverhow to pull 3rd maximum record sqlhow do you 2nd highest salary in sqlsecond highest salary in sql using rownumn highest salary in sql