How to select the duplicate rows from a table?

Answers were Sorted based on User's Feedback



How to select the duplicate rows from a table?..

Answer / nans

Select FIELD1 From <TABLENAME> As Temp Group By FIELD1 Having
Count(*) >1;

Is This Answer Correct ?    14 Yes 1 No

How to select the duplicate rows from a table?..

Answer / channabasappa

select field name from tablename where group by field name
having count(field name)>1;

Is This Answer Correct ?    1 Yes 0 No

How to select the duplicate rows from a table?..

Answer / mahesh vasudevan

Select <col-name> from table A1 and A2
where A1.Col = A2.Col.

This should be an inner join. Then you are finding the
intersection of the key values...if you want to find the
duplicates for all matching column of the rows code AND
condition for join with all those columns.....by the way
there are different easy ways to find it. but this is one of
the way.

Is This Answer Correct ?    0 Yes 0 No

How to select the duplicate rows from a table?..

Answer / pandu

select distinct from <field name> from <table name>

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More DB2 Interview Questions

How does coalesce work?

0 Answers  


Is db2 a mainframe?

0 Answers  


Can we use select query in a loop to fetch multiple rows in a COBOL PROGRAM? If so, what is the advantage of cursor?

1 Answers   UST,


Are views updatable ?

4 Answers  


Is ibm db2 free?

0 Answers  






What is a root page?

1 Answers  


Name some fields from SQLCA

1 Answers  


what is dynamic cursor?gives syntax for this?

1 Answers   TCS,


How will you delete duplicate records from a table?

7 Answers   Google,


i have one file having 100 of records? i want to display it like 20 records in one column and 20 records in another column total 40 records per page ? how ?

2 Answers   EDS,


In a DB2-CICS program which is acts as co-ordinator and which is participant?

1 Answers   IBM,


What is an access path?

3 Answers  


Categories