What is the SQL query to select, delete and get count of
duplicate rows in DB2?

Answer Posted / hkhatri27

SELECT Columns
FROM Table
GROUP BY Columns
HAVING COUNT(*) > 1;

~ Himanshu

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cursor stability in db2?

811


Define db2 and its databases?

619


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

710


Explain what are the various isolation levels possible?

609


What is with ur in db2?

758






What are the full forms of spufi and dclgen and why are they used?

654


What is a collection in db2?

579


How do you stop a db2 database in linux?

566


How to compare data between two tables in db2?

658


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

2276


How to check table size in db2 sap?

577


How do I start db2 in windows?

563


How do I import a csv file into db2?

560


What is package in cobol db2?

702


What is the use of commit in db2?

630