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


Please Help Members By Posting Answers For Below Questions

How to create a Master database in SQL server ?

551


What is the difference between varchar and varchar types?

568


Explain what is the difference between a local and a global temporary table?

515


What are the transaction properties?

555


What Is Rdbms?

673






Tell me what is sql profiler?

627


How use inner join in sql server?

617


what are database files and filegroups? : Sql server database administration

504


How to generate create view script on an existing view?

562


What is the difference RDBMS and Graph Database?

631


what type of index will get created after executing the above statement? : Sql server database administration

541


explain how to create a new schema in a database? : Sql server database administration

583


What are acid properties of transaction?

553


What is a full text index?

497


What is 1nf 2nf?

554