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 / prasoon madnawat

i forgot order by in da last post
SQL Server:
Select MIN(Salery) from (SELECT TOP 2 * from EMPLOYEE order
by Salery DESC)

Oracle:
Select MIN(Salery) from (SELECT * from EMPLOYEE where ROWNUM
<3 order by Salery DESC)

MySQL
Select MIN(Salery) from (SELECT * from EMPLOYEE order by
Salery DESC LIMIT 2)

likewise for 2nd minimum salery.

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of memory management? : Dot net architecture

492


How is the using() pattern useful? What is idisposable?

516


What is a clickonce application?

511


Explain the use of virtual, sealed, override, and abstract.

572


What re interop services?

564






How to improve the cache performance? : Dot net architecture

530


Name some changes done since version 3.0?

558


difference between Response.write,server.transfer and also which one is used when ?

1468


Explain about httpruntime.cach.get(); method?

573


How will you do windows authentication and what is the namespace?

542


What is Opf3

591


Can you explain update progress control?

524


What is different about namespace declaration when comparing that to package declaration in java?

561


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

455


Explain cache? : .NET Architecture

563