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 / kiran
select empid,salary
from (select distinct empid,salary,
Dense_Rank() over(order by salary desc) as Rank
from dbo.EmpSalary) b
where b.rank=3
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the difference between NOROW and LOCKROW?
How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?
What is sql server used for?
Explain view in sql server?
How can you start sql server in different modes?
What is difference between order by and group by?
How do you size a resultset?
Explain log shipping and mention its advantages.
What is linked report?
How to use subqueries with the in operators in ms sql server?
Define Wed Edition in SQL Azure?
How do you troubleshoot errors in a SQL Server Agent Job?
Why we use the openxml clause?
Explain subquery and state its properties?
Can another user execute your local temporary stored procedures?