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 / vinay singh

To find any number of Salary..

Select * From Table E1 Where
(n-1) = (Select Count(Distinct(E2.Sal)) From Table E2
Where E2.Sal> E1.Sal)


**Vinay Singh

Is This Answer Correct ?    8 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a schema in sql server 2005? : Sql server database administration

527


What is difference between delete & truncate commands?

562


what is blocking? : Sql server database administration

514


what is the sql equivaent of the dataset relation object ?

1580


what is the difference between writing data to mirrored drives versus raid5 drives. : Sql server administration

546






How can you find out how many rows returned in a cursor?

563


What are sql server functions?

526


What are relationships and mention different types of relationships in the dbms

565


How can windows applications connect to sql servers via odbc?

605


What is the main difference between ‘between’ and ‘in’ condition operators?

602


What are alternate keys?

580


How to create a simple stored procedure in ms sql server?

530


What are the types of database schema? : sql server analysis services, ssas

616


What is dbcc updateusage?

550


Define tool Manage Statistics in SQL Server 2000 query ?

533