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

What is difference between global temporary tables and local temporary tables?

1239


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1112


why would you use sql agent? : Sql server database administration

1221


What is the difference between SQL notification and SQL invalidation?

1198


What is normalization? What number of normalization shapes are there?

1112


How many columns can exist together per table?

1161


Can we insert data into a view?

1143


what is blocking? : Sql server database administration

1047


What is a trace frag? Where do we use it?

1104


Write SQL queries on Self Join and Inner Join.

1160


What is the bookmark lookup and rid lookup?

998


When is update_statistics command used?

1052


What are indexes in ms sql server?

1065


What are sp_configure commands and set commands?

1024


List out some of the requirements to set up a sql server failover cluster?

1034