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 |
What is default schema in mysql?
What is unsigned in mysql?
What is a trigger in mysql?
What is DML in MySQL?
What is int unsigned?
What is a mysql view?
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
What is the maximum connection pool size?
How can we optimize stored procedure?
What is the function of myisamchk?
What are the ways in which you can retrieve data in the result set of mysql using php?
What is the current version of mysql?