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
What is difference between global temporary tables and local temporary tables?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?
why would you use sql agent? : Sql server database administration
What is the difference between SQL notification and SQL invalidation?
What is normalization? What number of normalization shapes are there?
How many columns can exist together per table?
Can we insert data into a view?
what is blocking? : Sql server database administration
What is a trace frag? Where do we use it?
Write SQL queries on Self Join and Inner Join.
What is the bookmark lookup and rid lookup?
When is update_statistics command used?
What are indexes in ms sql server?
What are sp_configure commands and set commands?
List out some of the requirements to set up a sql server failover cluster?