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 / sarath

I don't know the exact intention of the above answers, but I am making mine clear that to find the TOTAL DUPLICATED RECORDS and THEIR COUNT OF REPETITIONS, the Pseudo code is:

Select col1,col2,col3,....,COLn count(*) from <TN>
group by col1,col2,col3,....,COLn having count(*) > 1;

Wish everybody complies with it, its tested.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

722


i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5

3207


Why do we use joins in sql?

502


What is nvarchar in sql?

522


Why is theta join required?

664






What is primary key sql?

546


What is the difference between the implicit and explicit cursors?

527


how can we destroy the cookie? : Sql dba

559


Why is nosql good?

597


Is sql an operating system?

545


What is partition by in sql?

569


what are the difference between clustered and a non-clustered index? : Sql dba

529


How do I quit sql?

502


what is cursor. write example of it. What are the attributes of cursor.

747


Does google use sql?

513