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


Please Help Members By Posting Answers For Below Questions

What is replace and stuff function in sql server?

561


What is ddl command?

529


Explain what are various ways to enhance the ssrs report?

568


What is the sql case statement used for?

557


What is log cache in sql server?

515






Which trace flags are enabled in sql server?

520


what is dbcc? : Sql server database administration

519


What is the recovery model?

553


What is “asynchronous” communication in sql server service broker?

537


If the job running very slow what is the action you do

1425


What is the difference between update lock and exclusive lock?

492


What is BLOCK statements in SQL?

804


What is the maximum row of a size?

569


What are .mdf files?

518


1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?

1534