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
Can we have two clustered index on a table?
Is primary key always clustered index?
How to avoid duplicate records in a query?
How to add new employee details in an employee_details table with the following details
What is rownum in sql?
How to assign sql query results to pl sql variables?
What is cursor and its types?
When is the explicit cursor used ?
What is interval partition?
Can we join tables without foreign key?
What does the acronym acid stand for in database management?
what are the different index configurations a table can have? : Sql dba
What are packages in pl sql and also explain its advantages?
what are sequences
How many sql statements are used?