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 are triggers in ms sql server?
What is trigger explain with program?
how many clustered indexes can be created on a table? : Sql server database administration
Can a rule be bound to any column of any data type?
How will you decide the active and passive nodes?
What are advantages of ssrs or why we should use ssrs?
How to return the second 5 rows in ms sql server?
Is mysql better than sql server?
Explain the difference between clustered and non-clustered index?
What is the distinction amongst delete and truncate?
How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication
Differentiate between a primary key and a unique key.
Types of Authentications in Sql Server? How user gets authenticated through windows authentication?
What is updatable resultset?
What are the two authentication modes in sql server?