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


Please Help Members By Posting Answers For Below Questions

Can binary strings be converted into numeric or float data types?

549


How to create percentile function?

108


Which database stores information about replication?

552


How can sql injection be stopped? : sql server security

546


Name 3 ways to get an accurate count of the number of records in a table?

570






What are the requirements on sql server network connections?

520


Explain SSRS Architecture?

139


What are the system database in sql server 2005?

549


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

569


What are date and time data types in ms sql server?

525


What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas

542


Explain what is raid and what are different types of raid levels?

532


Explain the usage of floor function in sql server.

502


What is the datatype of rowid?

506


What are different types of schemas?

516