from the table display the 2nd highest salary?
and also the least 2nd salay?
Answer Posted / prasanthi
Query for Getting 2nd least salary (replace 2 with any
number so that you will get any least salary:
select max(Salary) from Employee
where Salary in
(select distinct top 2 Salary from dbo.Employee order by
Salary asc)
Query for Getting 2nd Height salary (replace 2 with any
number so that you will get any least salary:
select min(Salary) from Employee
where Salary in
(select distinct top 2 Salary from dbo.Employee order by
Employee desc)
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the meaning of sql server?
What is a periodical index?
What is for xml in sql server?
What are Row versions of DataRow?
Explain full-text query in sql server?
What are magic tables in sql server?
When would you prefer to have a minimum number of indexes?
Do you know what are acid properties?
What are the different editions available in sql server 2000?
What’s the use of custom fields in report?
Who is the owner of a schema in ms sql server?
How do you create a clustered index?
How can you control the amount of free space in your index pages?
How to move database physical files in ms sql server?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?