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 is application frame host?

594


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

514


how to change the title of my window?

1419


What is an asssembly qualified name? Is it a filename? How is it different?

510


Explain difference between machine config vs. Web config? : .NET Architecture

542






Explain different pipelining hazards? : Dot net architecture

472


What is a virtual memory? : .NET Architecture

536


What is the importance of updatepanel control?

537


Differences between VS 2005, 2008 and 2010 ?

580


What is code access security (cas)?

571


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

524


What is private constructor? And it's use?

640


Explain dma? : Dot net architecture

557


How does an appdomain get created?

553


Differnce between managed code and unmanaged code ?

526