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

What is the use of COMMAREA ?Minimum how much data we can pass from it?

7 Answers   Cap Gemini,


What is referential integrity?

5 Answers  


What is an inner join, and an outer join ?

1 Answers   CTA,


the dd name for ksds is dest1 and what is the dd name for alternate index of ksds ? a.dest b.dest1 c.dest1a d.dd1

2 Answers   Logica CMG,


What is buffer pool?

1 Answers  


What is a result table?

1 Answers  


If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?

1 Answers  


my project is insurance management system,how to explain my work environment in interview?

2 Answers   CGI, Value Labs,


What is a DB2 catalog?

2 Answers  


What is the difference between nvl and coalesce?

1 Answers  


What is the difference between IN subselects and EXISTS subselect?

1 Answers   HCL, PreVator, TCS,


How to get the ddl of a table in db2?

1 Answers  


Categories