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 nth highest salary

Answer Posted / vinay upadhyay

These are tested queries to find Nth highest salary

Select distinct(sal) From employee emp Where n =
( Select Count(Distinct y.sal) From employee y Where y.sal
>=emp.sal)

OR

select distinct(salary) from employee order by salary desc
limit n-1,1

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 .mdf files?

1016


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

7010


What are the advantages of mirroring?

1044


Does partitioning improve performance sql server?

1032


What are various ways to enhance the ssrs report?

1035


What do you mean by table and field in sql?

1066


What are rest-style architecture's?

172


How to loop through result set objects using odbc_fetch_row()?

1048


What are distributed partitioned views?

1137


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

115


What are system databases into sql server (2005/2008) : sql server database administration

1053


How to connect ms access to sql servers through odbc?

1073


please differentiate between delete and truncate?

1041


What is transaction server consistency?

1107


How will you add a dimension to cube? : sql server analysis services, ssas

1139