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

What is difference between inner join and join?

1096


Is ssrs support other database except ms sql server?

142


Define a cross join?

1084


What are the built in functions in sql server?

1027


Explain the cursor lock types?

1097


Can we deploy SSRS reports on our personal website?

176


what are the new features in SSRS?

145


Explain datetime2 data type in sal server 2008?

951


can a database be shrunk with users active? : Sql server administration

1063


How to deploy the Report?

140


Characterize join and name diverse sorts of joins?

1021


How to create function with parameter in sql server?

1158


What is the difference between resultset and resultsetmetadata?

1030


How many partitions a clustered index has by default in sql server 2012?

1138


Is foreign key a primary key?

1177