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 / amit

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

Where n is no that u want which postion's salary u want
suppose second higest means n=2

Amit

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps to take to improve performance of a poor performing query? : sql server database administration

999


what protocol both networks use? : Sql server database administration

946


How to create a dynamic cursor with the dynamic option?

998


What is the sql case statement used for? Explain with an example?

954


How to create function without parameter in sql server?

1015


What is indexing and its types?

979


Explain steps of normalization?

958


Write a sql query to display the current date?

1053


What is the process of normalization?

1077


How to create a trigger for insert only?

1009


What are the differences between user defined functions and stored procedures?

1023


What is indexing in sql server with example?

952


How do you size a resultset?

888


Where do we use trace frag?

985


How do I view a script in sql server?

995