how to find 2nd highest salary in mysql

Solutions on MaxInterview for how to find 2nd highest salary in mysql by the best coders in the world

showing results for - "how to find 2nd highest salary in mysql"
Etan
16 Aug 2020
1#2nd Most highest salary using Limit & Order By
2SELECT Salary FROM (SELECT Salary FROM Employee ORDER BY salary DESC LIMIT 2) AS Emp ORDER BY salary LIMIT 1;
Nohan
08 Jan 2019
1#2nd Most highest salary using Group By, Order By & Limit clause
2SELECT sal FROM emp GROUP BY sal ORDER BY sal DESC LIMIT 1, 1;
Beatrice
24 Feb 2018
1#2nd Most highest salary using dense_rank()
2SELECT sal 
3FROM (SELECT dense_rank() over(ORDER BY sal DESC) AS R, sal FROM emp) employee 
4WHERE R = 2;
Karl
08 Jul 2016
1#Corelated Subquery
2SELECT Id, Salary
3FROM Employee e
4WHERE 2=(SELECT COUNT(DISTINCT Salary) FROM Employee p
5WHERE e.Salary<=p.Salary)
queries leading to this page
how to get the third highest salary in mysql2nd highest salary in mysql using limitsecond largest salary mysqlhow to find max salary in sql using subqueryhow to find highest salary in mysqlsql get second highest valuethird highest salary in mysqlhow to find the second highest salary in mysql2nd highest salary in sql using rank in mysqlget fourth highest salary in mysqlget 3rd highest salary in mysqlfind the second highest salary in mysqlnth max salary in mysqlfind to psecond saleety in sql optimze wayselect highest salary in mysqlselect 2nd highest salary in mysqlhow to find the tenth highest salary in mysqlfind the max salary sqlhow to find the highest salary in mysqlget second highest salary in mysqlhow to find 4th highest salary of employee in mysqlsecond max salary using havingquery for 2nd highest salary in sqlselect max salray from a table mysqlhighest salary query in mysqlselect 3rd highest salary in mysqlsecond highest salary in mysqlhow to get 2nd highest salary in sqlmysql query second highest salary4th highest salary in mysqlfind second highest salary in mysqlhow to find second largest salary in sqlhow to get the second highest salary in mysqlselect second highest salary in mysqlmysql query to get third highest salarymysql find the third highest salaryquery for nth highest salary in mysqltop salary employee mysql querynth highest salary in mysqlquery to find highest salary in mysqlsecond highest salary in mysql using limithow to find second and third highest salary in mysqlmysql highest salarysecond highest salary in sql using limithow to get second highest salary in mysqlhow to find 3rd highest salary in mysqlhow to find last 2nd highest salary in mysqlselect second highest salary mysqlmysql query for finding second highest salarymysql second highest salary2 sql query like max salary 2c 2nd max salary 2c 3rd max salary3rd max salary in mysqlfind the nth highest salary from table in sqlselect third highest salary in mysqlshallow last second salary in mysqlmysql third highest salary2nd highest salary in mysqlfinding top2 nd highest salary in sql3 highest salary in mysqlhow to find second highest salary in mysql without using subqueryfind second highest salary in mysql without limitemployee id salary is given query to get second highestmysql statement to get highest salaryhow to get 3rd highest salary in mysqlquery to find second highest salary of employee in mysqlwhat is the query to find second highest salary of employeehow to find nth highest salary in mysqlnth highest salary mysqlfind second highest salary in mysql using ifmysql query to get 3rd highest salarymysql query to get second highest salarywrite a query to find the second highest salary in the table from mysql 3ffind 3rd highest salary in mysqlmysql 2nd highest salarymysql query 2nd highest salaryfind 2nd highest salary in mysqlsecond max salary in mysqlsecond highest salary in mysql with limitfind nth highest salary in mysqlmysql query to find second highest salarysecond highest salary mysqlhow to find second max salary in mysqlget the second highest salary in mysqlmysql get second highest salaryhow to find 2nd highest salary in mysqlhighest salary in mysqlfind the 3rd highest salary in mysql3rd highest salary in mysqlto find second highest salary in mysqlquery to find third highest salary in mysqlhow do you find the 4th highest salary in mysqlwhat is display 2nd highest salary in mysqlhow to find second last employee salary find in mysqlhow to get third maximum salary in mysqlsecond lowest salary query in mysqlhow to find the second highest salary from employees salary in mysqlselect max salary rowhighest third salary in mysqlhow to find third highest salary in mysqlfind highest salary in mysqlmysql find third highest salaryselect second max salary in mysql5th highest salary in mysqlsecond highest salary query in mysqlhow to select 3rd highest salary in mysqlget third highest salary in mysqlhow to get highest salary in sqlhighest second salary in mysqlhow to find 2nd highest salary in mysql