how we can find nth max salary from an employe table by
using my sql?

Answers were Sorted based on User's Feedback



how we can find nth max salary from an employe table by using my sql?..

Answer / pious deepak

select salary from employee
order by salary desc limit n-1, 1

Is This Answer Correct ?    29 Yes 4 No

how we can find nth max salary from an employe table by using my sql?..

Answer / whatinaname

select max(salary) from employee
order by salary desc limit n-1, 1

Is This Answer Correct ?    14 Yes 2 No

how we can find nth max salary from an employe table by using my sql?..

Answer / ksam

select distinct(salary) from employee order by salary desc
limit n-1,1

Is This Answer Correct ?    6 Yes 2 No

how we can find nth max salary from an employe table by using my sql?..

Answer / nivedita

select max(salary) from employee order by salary desc limit 1;

Is This Answer Correct ?    3 Yes 0 No

how we can find nth max salary from an employe table by using my sql?..

Answer / jithu

Another way is::

SELECT sal FROM sal a WHERE n = ( SELECT count(*) FROM sal
b WHERE b.sal < a.sal)

Is This Answer Correct ?    4 Yes 2 No

how we can find nth max salary from an employe table by using my sql?..

Answer / sumit

select salary from employee e1
where (n-1)=(select count(*) from employee where
salary>e1.salary)

Is This Answer Correct ?    0 Yes 2 No

how we can find nth max salary from an employe table by using my sql?..

Answer / sandeep

select MAXIMUM(salary) from (select salary from employee
order by salary desc limit 'n')

n means number of rows

Is This Answer Correct ?    10 Yes 18 No

how we can find nth max salary from an employe table by using my sql?..

Answer / sandeep kumar

select salary from eployee

Is This Answer Correct ?    4 Yes 22 No

Post New Answer

More MySQL Interview Questions

What different Stored Objects are supported in MySQL?

1 Answers  


How can I insert images into a Mysql database?

0 Answers  


What are the disadvantages of stored procedures?

0 Answers  


how to display nth highest salary from a table in a mysql query? : Mysql dba

0 Answers  


What is trigger in mysql with example?

0 Answers  






What are the advantages of mysql in comparison to oracle?

0 Answers  


How do we delete a row in a table?

0 Answers  


How to create a table?

0 Answers  


how to delete duplicate rows in sql server 2005?

2 Answers   EWIT, Reliance,


How can I change database in mysql?

0 Answers  


Where the database is stored in mysql?

0 Answers  


What command is used to delete the data from the table without deleting the table structure?

0 Answers  


Categories