How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / amar banerjee
sol1> select MAX(salary) from emp where salary< (select MAX(salary) from emp);
sol2> select salary from emp sort by salary desc limit 1,1;
for finding nth position
select salary from emp sort by salary desc limit n-1,1;
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is sql server english query?
How to convert numeric expression data types using the cast() function?
What's the information that can be stored inside a bit column?
What is the significance of master, tempdb and model databases?
how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?
What are the fixed server level roles? : sql server security
What is coalesce in sql server?
When would you use it?
What is sql profiler. What are the default templates with it? : sql server database administration
What are the dmvs?
What is a sql join?
What is the difference between Triggers and Stored Procedure?
How to create sub reports?
What is self contained scalar sub query?
Difference between Logical Page and Physical Page in SSRS.