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
Can a function call a stored procedure in sql server?
What are entities and relationships?
Is the primary key column of a table an index in ms sql server?
When would you use the stored procedures or functions?
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration
What extended events?
What is the difference between online clustering and Offline clustering?
What happens if you delete a table that is used by a view?
How to create database with physical files specified in ms sql server?
What do you mean by an execution plan?
What is trigger and different types of Triggers?
What is the order in which the sql query is executed?
i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.
Can you name some of the dml commands in sql?
What happens if null values are involved in bitwise operations?