2nd max salary query in sql

Solutions on MaxInterview for 2nd max salary query in sql by the best coders in the world

showing results for - "2nd max salary query in sql"
Carl
20 Oct 2017
1SELECT MAX(SALARY) 'SECOND_MAX' FROM EMPLOYEES
2WHERE SALARY <> (SELECT MAX(SALARY) FROM EMPLOYEES);
Fabian
15 Aug 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; 
Matteo
05 Nov 2020
1SELECT MAX(salary) FROM Employee WHERE Salary NOT IN ( SELECT Max(Salary) FROM Employee);
Caterina
28 Sep 2019
1select *from employee 
2group by salary 
3order by  salary desc limit 1,1;
queries leading to this page
get 2nd highest salary in sqlquery to find the 2nd highest salaryhow to find the third highest salary in sqlsecond largest salary sql by maxsecond highest from sqlwrite an sql query to show the second highest salary from a table get 2nd highest salary in sql serverselect highest salary from table in sqlhow to get 2nd highest salary in sql using joinsql query to find second highest salary of employeeget second max salary queryselect 2nd max salary in sqlsecond highest salary employee sqlhow to get second highest salary using sql2nd max salary query in sqlfind out third highest salary in sqlfind the second highest salary in sqlhow to get a second highest salary in sqlsql query to get third highest salarythird maximum salary in sqlfind the largest 7 th salary in sql queryquery for second highest salaryhow to find max paid salary in sqlsql query to find second max salarymax 3rd salary sqlhow to get 4th highest salary in sqlhow to find last 2nd highest salary in sqlselect max salary in sqlget second highest salary in sqlhow to find 2nd highest salary in sqlhow to find maximum salary without using max function in sqlsql query to find the second highest salaryhow to get 3rd maximum salary in sqlfind 2nd highest salary in sql using rownumfind third highest salary and third lowest salary in sqlsql query to find 5th largest salary candidatefind the person with 2nd highest salary sqlhow to get second max salary in sqlhow to second highest salary in sql3rd highest salary in sqlhow to find the second maximum salary in sqlsql query to find third highest salaryquery for second highest salary in sqlhow to select 3rd highest salary in sqlthird highest or second highest salary queryfind second maximum salary in sqlwrite a sql query to get the second highest salary from employee tablefind second second highest salary in sqlhow to find top 2 highest salary in sqlsql query for 2nd lowest salaryhow to get the highest salary from the employee table in sqlsql query to select 2nd highest salaryselect second highest salary in sql with other datafourth highest salary in sqlsecond highest salary in sql server2nd max salary in sqlsql server 2nd highest salary2nd min salary in sqlfind the nth highest salary in sqlhighest second salary in sql using limitquery for taking second max salary in sqlwrite a sql query to print highest salary in consecutive yearsto find 2nd highest salary in sqlsql query to find the 2nd highest salaryto get second max employee salary sql querysql query to find second highest salarysql query find second highest salarysql 2nd highest salaryhow to find second max salary in sqlsql qury to get the second highest salarysecond minimum salary in sqlhow to get 2nd lowest salary in sqlprint second highest salary2nd maximum salary in sqlq how to get the second highest salary using sql 3ffind maximum salary in sqlprint second highest salary in sqlsql second highest salaryget the 2nd highest salary in sqlfind second max in sqlget second highest record in sqlselect second max salary in sqlhow to select 2nd highest salary in sqlhow to get 3rd max salary in sqlthird largest salary in sqlsql query to second highest salary3 max salary in sqlhow to get second maximum salary in sqlsql query second highest salaryget second most highest salary sqlget the second highest salary in sql3rd max salary in sqlcalculate second highest salary in sqlfind second max salary in sqlhow to calculate second max salary in sqlhow to find second highest salary in sql without using corelated querywhat is the query for second highest salary in sqlorder by second highest salary in sqlmysql query to get second highest salary second highest salary of an employee sqlselect the highest salary in sql queryt sql second highest salaryfind second largest salary in sqlsecond highest salary in sql query3rd maximum salary in sqlnth max salary in sqlsql command to find second highest salarywrite a sql query to find the second highest salary from employees table sql query for third highest salarysecond nd max salary in sqlsql query to get second highest salary using sub queryget the 3rd highest salary sqlmysql 3e select min 28salary 29 from user where salary in select salary from user order by salary desc 3bselect highest salary in sqlsql query to find people with 2 highest salrieshow to find 2nd max salary in sqlquery to get 2nd highest salary2nd and 3rd highest salary in sqlreturn 2nd hightst value in sqlsql query to find n highest salarysecond max salary in sqlhow to find the 3rd highest salary in sqlsecond lowest salary in sqlfind 4th highest salary in sqldb query to find 2nd highest salarywrite the query to get the 2nd highest salary in sql sql query highest salarysecond highest salary querysql query to find second highest salary 3fsql to find second highest salaryget second highest salary sqlget highest salary in sqlsql get second highest valuefind nth largest salary in sqlhow to find the 2nd highest salary in sqlsecond largest sql querysql query to get the 3rd highest salarywrite a sql query to get the second highest salary from the employee table sql query for second largest salarygetting second highest salary in sqlhow to select 2nd highest salary in mysqlwrite an sql query to find out the second highest salary from an employees table sql find second highest salarysql query to find 2nd highest salaryfind the second largest salary in sql queryselect the 5 th highest salary in sqlthird highest salary sqlhow to get second highest salary using limit in sqlfind the 2nd largest salary in sqlsql query to find the second highest salary of employee 3fsecond highest salary sqlselect 2nd highest salary in sqlsql query to find the employee with the second highest salaryget max salary in sqlsql select 2nd max salary2nd highest salary from employee tablehow many tuples will be retrieved by using following query on given table 3fselect max 28emp sal 29 from employee group by dept no 3b 2anth highest salary sql query2nd largest salary in sqlsql query to select second highest salarysql query to find out the second highest salary second highest salary sql servergetting 4th highest salary in sqlget third highest salary in sql2 max salary in sqlhow to 3rd maximum salary in sql querymin max salary in sqlsql second highest salary of employeehow to find the second biggest salary sqlsecond largest salary sqlsecond max salary in sql serverhow to get 2nd highest salaries in sql 3fselect max salary record sqlselect max salary sqlsql query for max salarylowest salary in sqlhow to find 2nd largest salary in sqlhow to find max salary in sqlhighest second salary in sqlhow do you 2nd highest salary in sqlfind the 2nd highest salary of an emplyeefind second highest salary sqlfind second largest salary sqlsecond highest sqlselect max 3 salary in sqlnth highest salary in sqlhow to find 3rd highest salary oehr in sqlfind 2nd highest salary in sqlfind 3rd max salary in sql using limitsecond highest salary from salary colun sql commandhow to print 2nd highest salary in sqlthird highest salary in sql using rownumsecond minimum salary sql queriessql query for find second highest salaryfind 2nd max salary in sqlemployee second highest salary in sqllist the employees with the heighest salaryfind the 2nd max salary in sqlsecond highest record in sql2nd highest salary in each department sqlsecond highest salary in sql using limitthird highest salary in sql3rd max salary sql queryhow to print 2nd and 3rd highest salary in sqlsecond highest salary my sqlsecond highest salary in sqlselect max salary for all the employeefinding second highest salary in sqlselect second highest salary in sql without using maxmax salary in sqlquery to find second highest salarysql query for 2nd highest salarysql queries for second highest salarysql query to find out highest salary from thefinding the third highest salary in sql2nd highest salary in sqlhow to find second highest salary in sqlhow to give find second highest salary in sql as second highest salarysecend highest salary sql querysql query to get second highest salaryfind second highest salary in sql using limithow to get 3rd highest salary in sqlmin salary in sqlget second highest salary of a particular department sqlsecond highest salary insqlsecond largest salary in sqlsql query on finding the second highest salary from the employee table max salary in nth sqlsql query to find 2nd maximum salaryfind the 2nd highest salary in sqlsecond maximum salary in sqlfind third highest salary in sql serverhow to get salary from another table in sqlwrite a query to figure out the highest employee salary the column is 27salary 27 third max salary in sqlhow to find top 2 salary in sqlhow to get max salary in each department in sqlsecond nth highest salary in sqlsql query to find 5th highest salaryhow to find minimum salary in sql2nd highest salary limit sqlhow to display second highest salary in sql2nd highest salary sql queryget second highest salary in sql using ctewrite a query for getting second largest salary from table 22employee 22 captionless imagefirst max salary in sqlget second highest salary from query sqllist the employee with the second height salaryquery second highest salary sql2nd highest salary sqlsql query to show the second highest salary from a tableselect max salary from employee tablesecond largest mysqlhow to find the second highest salary in sqlcalculate 2nd highest salary sqlhow to find the second largest number in sqlsql find 3rd highest salarynth highest salary sqlfind third highest salary in sqlgiven a table of employees and their salaries 2c write a query to find employee with the second highet salaryfind 2nd largest 28salary 29 write the query2nd highest salary in sql practicehow to find second highest salary in sql using subqueryhow to get 2nd max salary in sqlsql query for getting second highest salarywrite a sql query to print highest salary in 3 consecutive yearshow to find out 2nd highest salary in sqlmysql 2nd highest salarysql query to display second highest salaryn highest salary in sql2 highest salary in mysqlhow to get third highest salary in sqlfind the third max salary in sqlwrite sql query to find second highest salary of employeehow to find the 2nd highest salary in sql serverhow to find third max salary in sql2nd highest salary in sql using limit3rd highest salary in sql using limit4 th max salary sql commandmax 3 salary in sqlhow to find highest salary in sqlhow to calculate the second highest salary in sqlsql highest salaryhow to find top 3 salary in mysqlsql query for 2nd max salarysql query for second highest salarygive second highest salary in sqlto find second highest salary in sqlgetting 3rd highest salary sqlhow to find second highest salary in sql without using subqueryfind second highest salary in sqlhow to get 2nd highest salary in sqlsql second highest salary querysecond largest in sqlhow to find the tenth highest salary in sqlhow to get highest salary in sqlsql query to find second maximum salarytop 2nd highest salary in sqlhighest 2nd salary in sqlthird highest salary in sql using limithow to find the second highest number in sqlhow to find third highest salary in sqlhow to get the second highest salary in sqlsql query to find 2nd largest salary without using sub queryselect second max salary from sqlquery to find 3rd largest salaryquery to find 2nd highest salary14th highest salary sqlsecond highest salary codefind out the 2nd highest salary in sqlwrite an sql query to find 2nd highest salary in the given table nth highest salary in sql serversql select second highest salarysql to find third highest salarynth maximum salary in sqlquery to find 2nd largest salary in sqlsecond highest in sqlselect second highest salary in sqlhow to write the inner query to get the max salryfind second max salary query sqlsql query to find second highest salary with out using max 28 29 aggregator operator how to find the second max salary in sqlmaximum salary in sqlhow to get 2nd and rd highest salary in sqlselect 2nd highest salary in mysqlfind 3rd highest salary in sqlhighest nth salary in sqlhow to find second largest salary in sqlsecond max salary query in sqlhighest salary in sqltop earning employee mysql querysql query to find third max salaryhow to find a third and 6 highest salary in sql querysecond highest salaryquery to find maximum salary of employee in sql4th highest salary in sqlhow to get second highest salary in sql2nd maximum salary in sql serversql third highest salarynth highest salary in sql using ctehow to find second highest salary in sql using limithow to highest salary in sql2nd max salary query in sql