1. How to fetch all the duplicate records from the table.
2. How to fetch the second highest salary from the table.
Answer Posted / amit kumar
(1) Query to fetch 2'nd highest salary:
Select max(sal) from emptable where sal not in (Select
max(sal) from emptable)
(2) How to fetch all the duplicate records from the table.
SELECT COUNT(*), <COLUMN_NAME> FROM EDUCATION GROUP BY
<COLUMN_NAME>
| Is This Answer Correct ? | 10 Yes | 9 No |
Post New Answer View All Answers
Tell me about the approaches which you used to counter the DI problems.
Please illustrate physical database architecture? : SQL Server Architecture
What is amo? : sql server analysis services, ssas
How to create a view and a stored procedure in ms sql server using "create view/procedure" statements?
Explain hostprotectionattribute in sql server 2005?
List out the differences between global and local temp tables in sql server?
You accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover?
What do you mean by subquery?
Can the query output be sorted by multiple columns in ms sql server?
What is named calculation? : sql server analysis services, ssas
What is a view and what are its advantages?
How to drop an existing user defined function in ms sql server?
What is a mixed extent?
What is the use of for clause?
Explain about builtinadministrator?