from the table display the 2nd highest salary?
and also the least 2nd salay?

Answer Posted / smitha

2nd Highest Salary

Select top 1 salary from (select distinct top 2 salary
from employee order by salary desc)a
order by salary

2nd Least Salary

Select top 1 salary from (select distinct top 2 salary
from employee order by salary asc)a
order by salary desc

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What sql server means?

567


Explain about Normalization?

587


How to Check if table exists in sql server?

628


Explain what role entity and relationship play in an ER diagram.

585


What is multi-statement table-value user-defined function?

551






The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio

529


Is sql different from sql server?

521


How to use subqueries with the exists operators in ms sql server?

594


Which are the new data types introduced in sql server 2008?

520


How do I find the port number for sql server?

508


What is a subquery in a select query statement in ms sql server?

597


Explain indexed views and partitioned view with their syntax.

699


What is updatable resultset?

522


Explain temporary table vs table variable by using cursor alternative?

530


Difference between Sql server reporting services and Crystal reports?

124