please tell me the query to get details of the employee
having the second largest salary
Answer Posted / roshan
select employeeid, employeeName ,Salary from table1 where
Salary =(select min(a.Salary) from table1 inner join
(select top 2 Salary from table1
order by Salary desc) a on table1.Salary = a.Salary)
if we change the top value we will get the n'th largest
salary
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What stored by the model?
How to change the ownership of a schema in ms sql server?
Explain full-text query in sql server?
What are sub reports?
When would you use a before or after trigger?
How to call a function from a stored procedure in SQL Server ?
What do you understand by a view?
Explain insert into select statement?
How many categories of functions based their return modes?
What are the differences between substr and charindex in sql server.
What is a Join and explain its types?
Why are views required in the sql server or in any other database?
How to start and end transact-sql statements?
what is database replicaion? : Sql server database administration
How to make a remote connection in a database?