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
How to use old values to define new values in update statements in ms sql server?
How to create function without parameter in sql server?
What is the datatype of rowid?
What are secondary xml indexes?
What is a fill factor?
How to select all columns of all rows from a table with a select statement in ms sql server?
What does it mean to invest in the index?
What does executeupdate return?
What is sql server locking?
What is join and name different type of joins?
What is the most common trace flags used with sql server?
What is the architecture of ms sql reporting service?
Can we do dml on views?
What is the difference between varchar and nvarchar?
Explain cursor as data base object?