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 / sumesh.s.g

--Sumesh.S.G--
SELECT TOP 1 salary
FROM (select top 3 Salary
from dbo.TBL_Employee
order by Salary desc) as TemTable order by Salary asc
--Happy coding--

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What the difference between UNION and UNIONALL?

570


What are magic tables in sql server?

621


can SSRS reports Cache results?

113


What is self contained sub query?

557


What are the different type of replication in sql server?

536






What is truncate table?

546


What is a trigger and its types?

530


Explain what is sql server english query?

530


What is the use of commit?

540


What is acid properties?

590


How to create a scrollable cursor with the scroll option?

495


How to compare the top two records using sql?

764


What is the purpose of linked server configuration in sql server?

552


What is the difference between a primary key and a unique key? Are they the same?

540


Explain foreign key in sql server?

579