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
How to list all login names on the ms sql server?
How do I get to sql server configuration manager?
Tell me what is fill factor?
What are the database objects? : SQL Server Architecture
How to optimize stored procedures in sql server?
How to drop an existing schema in ms sql server?
How to create a login account in ms sql server to access the database engine using "create login" statements?
What is difference between Datepart() and Datename() in SqlServer?
What is pessimistic concurrency?
Explain the disadvantages/limitation of the cursor?
How to perform backup for certificates in sql server? : sql server security
What is difference between global temporary tables and local temporary tables?
what is an index? : Sql server database administration
What are the different types of Indexes available in SQL Server?
What are the parts of a function?