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 a synonym? How is it used?

2 Answers  


How to resolve -502 sql code in DB2?

2 Answers   Cap Gemini,


Which command is used to connect to a database in DB2 ? Give the Syntax.

0 Answers   MCN Solutions,


when does the SQL statement gets executed when you use cursor in the application programming ?

3 Answers   IBM,


What is rebind in db2?

0 Answers  






In my table having 100 Rec. How can I delete the 7th row?? (we don't know what is data inside the table)

9 Answers   IBM,


What do you need to do before you do EXPLAIN ?

1 Answers  


What is a lock?

1 Answers  


Is db2 relational database?

0 Answers  


what is the soft code for deadlock ?

2 Answers   Logica CMG,


What is an access path?

3 Answers  


Which component is responsible for processing sql statements and selecting access paths?

0 Answers  


Categories