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

How to connect ms access to sql servers through odbc?

731


Is the order of columns in the set clause important in ms sql server?

707


What is the advantage of sql server?

725


Explain the difference between control flow and data flow?

701


How to enter comments in transact-sql statements?

713






Differentiate between a primary key and a unique key.

791


Explain the collation?

824


What happens if time-only values are provided as date and time literals?

721


Why I am getting this error when renaming a database in ms sql server?

724


Your table has a large character field there are queries that use this field in their search clause what should you do?

690


Does sql server 2000 full-text search support clustering?

673


Explain transaction server implicit?

688


Can you use order by when defining a view?

730


What is named query? : sql server analysis services, ssas

690


How to get a list of columns using the "sp_help" stored procedure in ms sql server?

752