select the 3rd maximum salary from sql server database if 4
(just an example In practically I may not know the exact
situation) of the highest salaries are equal.
Answer Posted / shekhar
SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM tblSalary
ORDER BY salary DESC) S
ORDER BY salary
| Is This Answer Correct ? | 23 Yes | 4 No |
Post New Answer View All Answers
Explain candidate key, alternate key, and composite key?
What are differences in between sql server 2012 and sql server 2016?
Name some of the open source software that you can use in alternative to SSR?
What do you understand by a view? What does the with check option clause for a view do?
Can we delete data from a view?
How to fine-tune reports?
When to use null data driven subscription?
You want to implement the many-to-many relationship while designing tables. How would you do it?
How to update multiple rows with one update statement in ms sql server?
What is a partition key?
Can an entity have two primary keys?
Explain what are sparse columns?
How to find the second highest salary of an employee?
How can I track the changes or identify the latest insert-update-delete from a table?
Does sql server 2000 clustering support load balancing?