Second Highest Salary without subquery in MySQL | Nth highest Salary without subquery | MySQL second highest salary query

In so many interviews Interviewer will ask you a very simple MySQL query. And the question is :

How to select 2nd,3rd or the Nth highest salary from a table in MySQL ?

If you will answer with sub query like below query:

Next question might be asked like:

How to select 2nd,3rd or the Nth highest salary from a table in MySQL without using sub query ?

To get the second highest salary of an employee here is the MySQL query:

If you wanted to get 3rd highest salary then here is below MySQL query to get the 3rd highest salary:

If you wanted to get nth highest salary then here is below MySQL query to get the nth highest salary:

for example if you wanted to write MySQL query to get 4th highest salary of the employee then the query will be like:

  ...  Read More

Share This: