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
How does using a separate hard drive for several database objects improves performance right away?
Explain error and transaction handling in sql server?
What are various ways to enhance the ssrs report?
How can you ensure that the database and sql server based application perform well?
What area unit the various kinds of info compression introduced in sql server 2008?
Explain Capacity planning to create a database? and how to monitor it?
Explain what is meant by replication of database?
How many levels of sp nesting are possible?
What is Service Broker in sql server 2012?
When you should use a low fill factor?
Do you know what is raid and what are different types of raid configurations? : SQL Server Architecture
Explain microsoft sql server functions?
What are sql servers used for?
Is it possible to create trigger on views?
Explain collation?