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...

write the query for find the top 2 highest salary in sql
server

Answer Posted / tanay chaudhary

select * from(select emp.*,Dense_Rank() over(order by salary desc) as ranking from emp)as e where e.ranking in(1,2)

//emp=table name
//salary=column name

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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.

2399


What is advantage data architect?

925


What is used to replicate sessions between instances in coldfusion clusters?

1073


What is the difference between seek predicate and predicate?

1060


Explain about system stored procedure?

1035


What is a matrix in ssrs?

153


What stored by the tempdb ? : sql server database administration

1048


Is it possible to create trigger on views?

987


Can you explain important index characteristics?

993


How do I find the query plan in sql server?

962


Define a cross join?

1029


What is Extended user-defined?

962


What is the downside of using udf?

1109


How to create a testing table with test data in ms sql server?

1084


Explain the difference between primary keys and foreign keys?

1028