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

Do you know the cursor types?

1130


How secure is sql server database?

973


what is raid? : Sql server database administration

995


Explain about sql server login?

1049


What do you mean by cardinality?

870


Suggest a method of joining two tables.

1127


What are the disadvantages of primary key and foreign key in SQL?

1074


What is lock escalation and what is its purpose?

938


How to enter unicode character string literals in ms sql server?

1039


how to determine the service pack currently installed on sql server? : Sql server database administration

932


How to delete duplicate rows from table except one?

954


How can I get data from a database on another server?

957


What is nonclustered index on computed columns?

927


How to create a large table with random data for index testing in ms sql server?

999


List out the differences between the clustered index and non-clustered index in sql server?

963