How to retrieve Duplicate Rows only in a Table?
Suppose if a Table Name is "Education". It consists of
multiple columns. Then if we insert rows into this table
with duplicate records then how can we retrieve only
duplicate records from that table?

Answer Posted / smita

select a.empno, a.empname from education a,
(select empno, count(*) cnt from education group by empno
having count(*) > 1) b
where a.empno = b.empno

is the correct answer

Is This Answer Correct ?    12 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a table contain multiple foreign key’s?

581


How do you explain an index number?

541


What are the types of variables use in pl sql?

515


How to execute a stored procedure?

567


How do you go back in sql?

535






what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba

622


What is a table in a database?

587


Where is pl sql used?

523


What is right join in sql?

559


What is cte?

580


What does truncate mean in sql?

538


What is a variable in sql?

518


How does cross join work in sql?

537


In a distributed database system, can we execute two queries simultaneously?

573


Explain 3 basic parts of a trigger.

843