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


Please Help Members By Posting Answers For Below Questions

What are data regions?

90


Can We Use Data-grids For Our Report In Ssrs?

147


Explain try...catch with sql server?

587


How to find the source of a table in sql server?

519


what are the important architecture components of SSRS?

92






What is normalization of database? What are its benefits?

509


query processing

1729


what is the difference between openrowset and openquery?

585


What happens if date-only values are provided as date and time literals?

528


How do you make a trace?

573


what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

524


IF more than one Site is accessing the same Database server and I want to move the DB with Minimum down time? How will you do

1322


Define cursor locking

540


What is the difference between ddl and dml?

557


Do you know how to implement service broker?

531