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
Write a code to select distinct records without using the DISTINCT keyword.
Which sql server is best?
What are different types of collation sensitivity?
How to list all user defined functions in the current database?
What is trigger in salesforce?
What function does a database engine serve in the sql server?
Explain the microsoft sql server delete command? : SQL Server Architecture
What are the different types of columns types constraints in the sql server?
What is an example of a primary key?
What is the security principal at the server level that represents your session?
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
How to drop an existing stored procedure in ms sql server?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
What is 3nf normalization?
What do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?