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 query for fourth maximum salary from employee table

Answer Posted / santhosh

;with result as
(
--use dense_rank instead of row_number or rank
select salary, DENSE_RANK() over (order by salary desc) as denserank
from Employees
)
select top 1 * from result
where denserank = 4

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

as a general practice, it is recommended to have dbo be the owner of all database objects however, in your database you find number of tables owned by a user other than dbo, how could you fix this? : Sql server administration

914


How to use subqueries with the in operators in ms sql server?

1008


Explain cross join or cartesian product in sql?

840


What is a view and what are its advantages?

1053


What are secondary xml indexes?

984


What is 2nf in normalization?

945


How to delete duplicate rows from table except one?

931


Where are full-text indexes stored?

945


When would you use the stored procedures or functions?

947


What is the difference between TRUNCATE and DROP?

1064


Is the order of columns in the set clause important in ms sql server?

926


What is query cost in sql server?

935


What is compound operators?

975


What is meant by Active-Passive and Active-Active clustering setup?

1067


What is provisioning, billing and metering, and connection routing concepts in the service layer?

113