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 / sunil nair

SELECT EmpID,Salary from tblSalary a where 3=(select count
(distinct EmpID) from tblSalary b where b.empid>=a.empid)

For any database

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by referential integrity?

747


What are the disadvantages of merge replication?

967


How to list all schemas in a database?

780


What is collation sensitivity?

713


What happens if null values are involved in comparison operations?

713






What do you need to connect php to sql server?

752


Give main differences between "Truncate" and "Delete".

766


explain the storage models of olap? : Sql server database administration

676


How many categories of data types used by sql server?

761


Explain the steps to use transact-sql cursor?

664


What are sp_configure commands and set commands?

717


what is a correlated sub-query? : Sql server database administration

672


How to deploy the Report?

107


How do I repair damaged sql server mdf file database? In previous day my mdf file has got damage due to unknown reasons then I used dbcc chekcdb command but it failed, MDF file is important for me, I don’ know that how to get back mdf file data. Please anyone suggest me?

1513


Define cursor locking

738