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

Why use cursor in sql server?

1086


How to update muliple row in single query?

1068


Can we call future method from trigger?

948


Why I am getting this error when dropping a database in ms sql server?

1083


What should be the fill factor for indexes created on tables? : sql server database administration

1146


Why we need to use secondry database file? though, we can do same work using primary database file also.

6899


what is difference between NULL and ISNULL in SQL Server 2008?

1023


Can group functions be mixed with non-group selection fields in ms sql server?

952


What is bcnf normalization form?

1125


What does the on update no action do?

1034


Difference between Sql server reporting services and Crystal reports?

172


What are different types of database indexes?

1109


Why we use the openxml clause?

1019


what are the different types of SSRS reports?

155


What are the character string functions supported by sql server 2005?

1021