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 / p rem satyam

This is perfect
...............................

select * from emp e1 where (N-1)=( select
count(distinct(e2.sal) from emp e2 where e2.sal > e1.sal)

where N is level of sal. suppose you want 3rd higest sal then
in place u write 3 i.e write (3-1).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are various ways to enhance the ssrs report?

993


What is transaction server implicit?

949


What are the types of dml?

931


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1962


What are the different types of cursor?

1042


If I delete a template from the list in sql studio, will it be deleted from the hard disk? : sql server management studio

935


Explain the working of sql privileges?

1041


tell me what is blocking and how would you troubleshoot it? : Sql server database administration

847


What is change data capture (cdc) feature?

1000


How do I perform an unattended install of sql server 2000?

1020


What is sql sandbox in sql server?

1149


When should you use an instead of trigger?

922


What is ms sql server service broker?

935


What are alternate keys?

937


What is full outer join in sql server joins?

986