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 are database states in ms sql server?

832


How would you choose between a clustered and a non-clustered index?

733


How to find table changes in sql server?

827


Tell me something about security and sql azure?

112


Can you explain what is indexed view? How to create it?

717






What information is maintained within the msdb database?

724


How many types of relations are there between dimension and measure group? : sql server analysis services, ssas

941


Write the SQL query to drop, truncate and delete table.

728


What is subquery? Explain the properties of a subquery?

682


Can one drop a column from a table?

752


what is package and it uses and how can u call a package

1774


What it means to be triggered?

662


Explain security with sql azure?

171


How to truncate the log in sql server 2012? : sql server database administration

782


How to move database physical files in ms sql server?

691