Suppose there are many duplicate records in a Db2 table.
What is the query to retrive only duplicate records?

Answer Posted / sanj

say col1 is having duplicates in table tabA.Then,

select col1 from tabA
group by col1 having (count(col1) > 1)

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?

7100


List out the buffer pools in db2

722


Following a db2 update statement, what is the quickest way to compute the total number of updated rows?

711


What are the two types of logging in the db2 database? Explain them.

672


can we view the access paths created by dbrm ? how ? thx

6439






How to check sequence on a table in db2?

691


How can record locking be achieved in those DB2 versions which do not support it?

720


Comment whether dclgen is mandatorily used. If not, then what is the point of using it?

705


What is performance tuning db2?

733


What is sqlca’s maximum length?

791


What is clone table?

684


Explain the contention situations caused by locks?

681


Differentiate between cs and rr isolation levels? Where do you specify them?

671


How to find the number of rows in a db2 table?

744


What is the usage of open cursor command?

684