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 is default schema in mysql?

0 Answers  


What is unsigned in mysql?

0 Answers  


What is a trigger in mysql?

0 Answers  


What is DML in MySQL?

1 Answers  


What is int unsigned?

0 Answers  


What is a mysql view?

0 Answers  


when i declare date data type in sql ,i inserted the date 22-10-2012,but my result is in different date 1894-07-11 any one pls help me what's wrong in my query Create table orders(od_id int,od_name varchar(10),od_date date) insert into orders values(1,'sai',22-10-2012) and any one pls suggest what i can learn for 3 years real time experenice in sql because i am looking for database field

1 Answers  


What is the maximum connection pool size?

0 Answers  


How can we optimize stored procedure?

0 Answers  


What is the function of myisamchk?

0 Answers  


What are the ways in which you can retrieve data in the result set of mysql using php?

0 Answers  


What is the current version of mysql?

0 Answers  


Categories