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
Will the writetext statement activate a trigger?
What is schemabinding a view?
What is the difference between TRUNCATE and DROP?
what is bit datatype? : Sql server database administration
How to get a list of columns in a view using the "sp_help" stored procedure?
What is indexing and its types?
How to find which stored procedure is currently running in sql server?
What is surrogate key? : sql server analysis services, ssas
What is system stored procedures?
Does sql server use java?
What is an indexing strategy?
What causes index fragmentation?
Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
What are different types of data sources?