from the table display the 2nd highest salary?
and also the least 2nd salay?
Answer Posted / bobby
select p.emp_id,p.name,p.salary from
(select emp_id,name,salary,dense_rank()over( order by
salary desc)maxrank,
dense_rank()over( order by salary asc)minrank from test)p
where maxrank=2 or minrank=2
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is nolock?
What is snapshot parameter in ssrs?
List some advantages and disadvantages of stored procedure?
Why do we use sql limitations? Which constraints can we use while making a database in sql?
How do you clear a log file?
What is index, cluster index and nonclustered index?
What will be the maximum number of indexes per table?
How can we delete a table in sql server?
what types of replication are supported in sql server? : Sql server database administration
Why do we use trigger?
Where are stored procedures in sql server?
What are the different types of locks in the database?
can we have a nested transaction? : Sql server database administration
How do you delete a trigger?
What security features are available for stored procedure?