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

Answers were Sorted based on User's Feedback



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

Answer / gouri

select column_1 from tablename groupby column1 having coun(*)>1

Is This Answer Correct ?    11 Yes 4 No

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

Answer / chidambara subbu

SELECT City FROM Customers
Group by City
HAVING COUNT(City) > 1

Is This Answer Correct ?    3 Yes 0 No

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

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

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

Answer / azharuddinsyed

SELECT <COLUMN_1> FROM TABLENAME
GROUP BY COLUMN_1
HAVING COUNT(COLUMN_1) > 1

OR

SELECT <COLUMN_1> FROM TABLENAME
GROUP BY COLUMN_1
HAVING COUNT(*) > 1

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

how 2 resolve the -311 sqlcode

1 Answers  


What is package in db2 mainframe?

0 Answers  


What is buffer pool and list some of them?

0 Answers  


What is the usage of open cursor command?

0 Answers  


Mention a credible reason why select* is never given preference in an sql program that has been embedded.

0 Answers  


wht is d/f between union and joins ?

2 Answers  


pls explain the precompilation process of cobol-db2 pgm

3 Answers   HCL, IBM,


what needs to be done if a table is in copy pending / check pending status?

5 Answers   Xansa,


how to check the table is empty or not?

3 Answers   IBM,


What is a clustering index ?

3 Answers  


What is scrollable cursor in db2?

0 Answers  


What is release/acquire in bind?

0 Answers  


Categories