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 .net mobile images control. Explain with an example? : Microsoft dot net mobile

593


What happens when you try to update data in a dataset in .net while the record is already deleted in sql server as backend?

606


What is the difference between primary & secondary storage device? : Dot net architecture

606


Explain the purpose of cache? : Dot net architecture

548


Explain domestic architecture artifacts? : Dot net architecture

598






Explain different pipelining hazards and how are they eliminated? : Dot net architecture

579


What is .net mobile input validation. : Microsoft dot net mobile

614


What is textbox control of .net mobile? : Microsoft dot net mobile

703


Explain cache memory? : Dot net architecture

629


What is the numeric attribute of the textbox control in .net mobile? : Microsoft dot net mobile

612


What is .net mobile utility controls. Explain with an example? : Microsoft dot net mobile

544


Is dim fs as filestreamobject is a managed code? : Dot net architecture

576


What other than biginteger has been introduced in system.numerics namespace?

629


What is Video Streaming in .net??

644


5. Wcf- Session Managment

1658