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

Answer Posted / preeti chauhan

CREATE TABLE T1(SALARY int, [NAME] varchar(50))
SELECT TOP 1 SALARY FROM (SELECT TOP 2 SALARY FROM T1 ORDER
BY SALARY DESC)T1 ORDER BY SALARY

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will be the maximum number of index per table?

589


What is xml datatype?

659


How to include text values in sql statements?

592


What is a non equi join?

544


What is sql collation?

655






What is set nocount on and what is set nocount off?

515


How to maintain a fill factor in existing indexes?

533


Explain the categories of stored procedure?

520


Which table keeps information about stored procedures?

535


What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio

590


Where are stored procedures in sql server?

564


What is an identity column in insert statements?

587


Explain different types of locks in sql server.

598


What is the difference in accessing db between sql server vs sql azure?

157


In which format does an image save in SQL Server database ?

596