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

What is the difference between composite index and covering index?

507


Can one drop a column from a table?

547


Tell me what are cursors and when they are useful?

506


What is dbcc? Give few examples.

572


How do I find the transaction log size in sql server?

513






What are key, name and value columns of an attribute? : sql server analysis services, ssas

568


what is memory-optimized nonclustered indexes

554


What is the maximum size of sql server database?

500


Explain primary key in sql server?

565


What stored by the model?

546


Mention what are the different types of ssrs reports?

98


Can two different columns be merged into single column? Show practically?

606


How to execute a sql statement using mssql_query()?

541


1.how to find the dead lock in sql server? 2.How to fine the memory leaks in sql server? 3.suppose transaction log file increasing what action will take ?

1547


Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?

612