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 we have two clustered index on a table?

558


Is primary key always clustered index?

532


How to avoid duplicate records in a query?

575


How to add new employee details in an employee_details table with the following details

642


What is rownum in sql?

557






How to assign sql query results to pl sql variables?

507


What is cursor and its types?

550


When is the explicit cursor used ?

588


What is interval partition?

539


Can we join tables without foreign key?

520


What does the acronym acid stand for in database management?

535


what are the different index configurations a table can have? : Sql dba

566


What are packages in pl sql and also explain its advantages?

527


what are sequences

1087


How many sql statements are used?

562