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 is the purpose of sql profiler in sql server? : sql server database administration

616


Why use view instead of a table?

509


Can another user execute your local temporary stored procedures?

534


What are truncate options available in sql server? : sql server database administration

577


What is sql server database?

490






What the different components of Replication and what is their use?

548


What are the disadvantages of using querystrings to send data from one page to another?

578


How to add more data to the testing table in ms sql server?

544


What is provisioning, billing and metering, and connection routing concepts in the service layer?

92


How you provide security to cube? : sql server analysis services, ssas

529


What is mapping schema?

565


Explain how to send email from sql database?

554


What are the disadvantages of merge replication?

762


What is a field name?

507


What is the maximum size of a dimension? : sql server analysis services, ssas

550