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
(EmpID) from tblSalary b where b.empid=a.empid)

for any RDBMS

Is This Answer Correct ?    2 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is raid? : Sql server database administration

549


What are 3 ways to get a count of the number of records in a table?

609


What is the standby server?

515


Where is trigger in sql server?

536


How to sort query output in descending order in ms sql server?

542






How to locate and take substrings with charindex() and substring() functions?

508


What is check constraint in sql server?

521


What is the simplest way to create a new database in ms sql server?

531


What is a synonym for manipulation?

544


Can you explain different types of locks in sql server?

522


What are the dmvs? : sql server database administration

592


Is sql server free?

522


How to transfer data from a cursor to variables with a "fetch" statement?

582


Is it possible to replicate data from sql server to oracle? : sql server replication

543


Does an index slow down updates on indexed columns?

577