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 / bobby

select p.emp_id,p.name,p.salary from
( select emp_id,name,salary,dense_rank()over( order by
salary desc)rank
from empTable )p
where rank=2

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is exporting utility?

544


What are horizontal and vertical scaling?

146


Can two tables share a primary key?

522


You are doing log shipping due to some reasons it is failing. How you will proceed from there

1549


What is a periodical index?

510






What is sql server programming?

557


What is a trigger what are the advantages of trigger?

531


Does table partitioning improve performance?

536


1. Tell me your daily activities 2. If sql server installation fails at time installation what will do 3. Where does the sql server installation log details are stored 4. After the installation what will you do for memory configuration 5. What is the difference between SQL max maximum memory and AWE memory 6. How will you configure AWE memory 7. How will setup an email alert for the backup job 8. After the SQL installation what are the jobs will you configure 9. What does –g mean in the sql startup parameter 10. What is the difference between Bulked log and Full recovery model 11. What is the difference between mirroring and log shipping 12. What are the steps to be followed before in-place up gradation 13. After installing the patch the sql server does not start and application team tells to rollback the changes .In this scenario what will you do

2069


What is a partition function in sql server?

537


How to write a query with a right outer join in ms sql server?

485


What is the stuff?

529


Describe how to use the linked server?

607


How to send email from database?

588


What are sql dirty pages?

563