What is the SQL query to select, delete and get count of
duplicate rows in DB2?
Answer Posted / igor kramov
DELETE FROM (
SELECT ROWNUMBER() OVER (PARTITION BY c1, c2 ORDER BY c3
DESC) AS rnum FROM t1)
WHERE rnum > 1 ;
the same is for Select\Count
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
How do you find the maximum value in a column in db2?
What is a buffer in memory?
How do I change the column size in db2?
Which component is used to execute the sql statements?
How do you stop a db2 database in linux?
What are packages in db2?
What are db2 tables?
What is phantom read in db2?
What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?
How do you simulate the explain of an embedded sql statement in spufi/qmf?
What are iseries servers?
Who uses db2?
How to run db2 command in windows?
What is an instance database?
What is the function of logging in the db2 database?