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
How to resolve the orphan use problem? : sql server security
Does the order of columns in update statements matter?
What is difference between primary key and foreign key?
how many layers of tcp/ip protocol combined of? : Sql server database administration
What is wrong with sql server client libarary dll, ntwdblib.dll?
How to count rows with the count(*) function in ms sql server?
Explain about Joins?
Where actually sql azure database is hosted?
How would we use distinct statement? What is its use?
What is database isolation in sql server? : sql server database administration
How to test a dml trigger in ms sql server?
What is inner join in sql server joins?
What is clustered vs nonclustered index?
How to create new tables with "create table" statements in ms sql server?
Can you please explain the difference between primary keys and foreign keys?