Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / aditya kumar bisoi

SELECT EmpId,Salary
FROM(SELECT ROW_NUMBER() OVER(ORDER BY Salary Desc) AS [ROW_NUMBER],* FROM (SELECT DISTINCT Salary,Empid FROM EMPDetails)Emp)Emp1
WHERE ROW_NUMBER BETWEEN 2 AND 5

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to provide values to stored procedure parameters in ms sql server?

976


How to find the login name linked to a given user name?

945


What does the not null constraint do?

1002


What are cascading parameters in ssrs reports?

212


What is attribute relationships, why we need it? : sql server analysis services, ssas

911


What are the filtered indexes?

978


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1991


Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

841


What is difference between unique and primary key?

857


Define tool Manage Statistics in SQL Server 2000 query ?

1026


How to download and install microsoft sql server management studio express?

976


Can one drop a column from a table?

967


how many bits ip address consist of? : Sql server database administration

849


How to retrieve error messages using mssql_get_last_message()?

994


What are system databases in ms sql server?

968