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 difference between views and tables?
What is co-related sub query?
How to create indexed view?
What is 2nf normalization?
what are the new features introduced in sql server 2000? : Sql server database administration
How to execute a sql statement using odbc_exec()?
What is difference between order by and group by?
What is difference between getdate and sysdatetime in sql server 2008?
What is a covering index?
What do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?
on line cluster can we make if yes tell me the procedure
How exceptions can be handled in sql server programming?
How much memory that we are using in Logshipping Concept?
What is a transact-sql statement?
Why I am getting this error when renaming a database in ms sql server?