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

What is .net viewstate?

593


server.transfer limitation ?

1873


How do I know when my thread pool work item has completed?

589


What is biginteger and when would you use that?

625


Explain the race around condition? : .NET Architecture How can it be overcome? : .NET Architecture

582






4. Wcf- what Asych and Sych call and how that works

1540


Explain domestic architecture artifacts? : Dot net architecture

598


State and explain about microsoft.net?

608


Define cache coherency? : Dot net architecture

651


what are the events for a form?

1709


What is .net mobile images control. : Microsoft dot net mobile

573


How do I prevent concurrent access to my data?

644


Waht is Dot net Arcitecture

2039


What is application frame host?

695


Explain the purpose of cache? How is it used? : Dot net architecture

639