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

Is sql server free?

976


What is cursor in ms sql server?

1204


What is the difference between writing data to mirrored drives versus raid5 drives

990


Define full outer join?

1012


Where are stored procedures in sql server?

1128


What is cached report?

150


What is the difference between Clustered and Non-Clustered Index?

1105


Which database stores information about replication?

1127


What is difference between inner join and join?

1096


Can sql servers linked to other servers like oracle?

1011


Mention the 3 ways to get a count of the number of records in a table.

1025


What is etl - extraction, transformation, and loading?

960


Do you think BCNF is better than 2NF & 3NF? Why?

1342


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

1029


Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.

2462