how we can find nth max salary from an employe table by
using my sql?
Answers were Sorted based on User's Feedback
Answer / pious deepak
select salary from employee
order by salary desc limit n-1, 1
Is This Answer Correct ? | 29 Yes | 4 No |
Answer / whatinaname
select max(salary) from employee
order by salary desc limit n-1, 1
Is This Answer Correct ? | 14 Yes | 2 No |
Answer / ksam
select distinct(salary) from employee order by salary desc
limit n-1,1
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / nivedita
select max(salary) from employee order by salary desc limit 1;
Is This Answer Correct ? | 3 Yes | 0 No |
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 |
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 |
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 to see the database architecture in MySQL??
How would you get the current date in mysql?
What is the storage engine for mysql?
Is mysql a nosql database?
How do I clear a mysql database?
What is definer in mysql trigger?
Why do we use pragma autonomous transaction?
What is general log in mysql?
how to find 2nd highest salary in random database salary of employer.....
How do I change a procedure in mysql?
1)for snapshot replication which agents used? 2)for Transcation replication which agents used? 3)for merge replciation which agents used?
How to list or view all databases from the mysql server.