can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com

Answer Posted / darshan shah

select top 1 * from (select top 2 * from emp order by sal
desc ) a order by sal asc



Plz try this.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know concepts and capabilities of sql server?

570


What is triggers and stored procedures?

506


Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?

566


Explain the steps to use transact-sql cursor?

516


What is bcp? When does it use?

505






What is bulkcopy in sql?

552


What are the indexes in sql server?

496


Do you know sql server 2008 backup compression?

558


Does order by actually change the order of the data in the tables or does it just change the output?

643


How to write a query with a right outer join in ms sql server?

471


What are audit control procedures?

580


What is a field name?

503


Describe in brief databases and sql server databases architecture.

517


What does indexation mean?

520


What is the xml datatype?

617