1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / ashwini
2. Second highest salary from the table
select top 1 salary from emp where salary NOT IN
(SELECT MAX(salary) FROM emp)order by salary desc
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are various limitations of the views?
What is 2nf in normalization?
How to drop an existing schema in ms sql server?
How many types of attribute relationships are there? : sql server analysis services, ssas
List out the differences between global and local temp tables in sql server?
How to list all stored procedures in the current database using ms sql server?
What is pessimistic concurrency?
Explain what are the restrictions that views have to follow? : SQL Server Architecture
Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
how to use DTS package in 2000,2005,2008 in sql server
What is it unwise to create wide clustered index keys?
Why do we need normalization?
What is the difference between rank and dense_rank?
What is difference between clustered index and non clustered index?
Explain in brief about Microsoft SQL server?