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

Can one drop a column from a table?

1020


what is the difference between openrowset and openquery?

1087


What are a scheduled jobs?

956


How can you start sql server in different modes?

971


What is TDS(Tabular Data Stream) Gateway?

121


Difference between DELETE and TRUNCATE?

1047


What is an expensive query?

931


How to execute multiple stored procedures at one time in sql server?

1011


What are key constraints?

976


Explain different types of locks in sql server.

1079


What is mean by candidate key?

1011


How can you find out which stored procedures are recompiling?

918


How to add code to the existing article (using improve article)?

1110


How to assign null values to variables or columns?

976


What are the system database in sql server 2005?

1044