How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database

plz mail the answer @ mak2786@gmail.com

Answer Posted / ravi kumar

SELECT MIN(sal) FROM Emp WHERE sal in
(SELECT TOP 2 DISTINCT sal from Emp ORDER BY DESC)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the new features are introduced in sql server 2012 reporting services?

107


Explain Normalization and DE normalization

606


Determine how to use the inserted and deleted pseudo tables?

533


What is triggers and its types?

540


What is the partitioning method?

528






How do you run a trace?

515


Delete duplicate rows without using rowid.

1066


How to execute a sql statement using odbc_exec()?

570


What is sqlcmd?

553


What is a schema in ms sql server 2005?

564


What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?

468


How many replicas are maintained for each sql azure db?

106


What is the difference between TRUNCATE and DROP?

627


How to drop an existing stored procedure in ms sql server?

540


Does index slows down insert statements?

584