how to find the 2nd higgest salary in the column for example
take table name is employee?
And also find bottom 2nd lowest salary ?

Answer Posted / sudhir

1. 2nd highest salary=>

Select top 1 * from (select top 2 * from emo order by sal
desc) order by sal asc

2. 2nd lowest salary

Select top 1 * from (select top 2 * from emo order by sal
Asc) order by sal Desc

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can implement drag and drop using atlas?

570


Describe the advantages of writing a managed code application instead of unmanaged one. What is involved in certain piece of code being managed?

612


What is gui programming? : .NET Architecture

507


what are constructors and destructors?

1722


where should I put this information then?

587






Explain the difference between state server and sqlserver : Dot net architecture

455


Difference between type constructor and instance constructor?

551


Differnce between managed code and unmanaged code ?

526


Can you explain control extenders?

521


The maximum report processing jobs limit configured by your system administrator has been reached.How I can Solve this problem when i using crystal report to load from my application.

14067


Define cache coherency and how is it eliminated? : Dot net architecture

524


Can I create my own permission set?

533


Explain the purpose of cache? : Dot net architecture

477


Is .net easier than java?

523


Explain how to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile

500