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 / ashish kumar

To find nth maximum salry

Select salary from tbl_name a where
n-1=(Select count(distinct(count(*))) from tbl_name b
where b.salary>a.salary)

Is This Answer Correct ?    10 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are trace flags and mention a few common trace flags used with sql server?

559


What is a deadlock and what is a live lock?

582


What is SQL Azure?

85


You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?

538


We need to perform what steps in the following order to work with a cursor?

722






How to create “dependant” parameter “make, model, year”

91


Explain why variables called the most powerful component of ssis?

540


Write a query for primary key constraint with identity key word?

583


Can group by and orderby be used together?

604


What is named calculation? : sql server analysis services, ssas

539


What is the largest component inside a field?

539


How many clustered indexes there can be on table ?

610


What are the disadvantages of indexes?

540


What is the difference between SQL notification and SQL invalidation?

600


What are views in ms sql server?

606