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 are the different types of sub-queries?
Explain system rowset functions?
Detail about query optimizer?
Do you know nested transaction?
Do you know what are pages and extents? : SQL Server Architecture
What is self contained multi valued query?
What is the default schema of your login session in ms sql server?
Can you explain the disadvantages/limitation of the cursor?
Does full backup break log chain?
What are different types of subquery?
List layers of abstraction microsoft architectured to provide relational db through cloud platform ?
What security features are available for stored procedure?
Can two tables share a primary key?
How can we migrate from SQL server to SQL Azure?
Distinguish between commit and rollback?