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
When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?
Explain how can you do the explain of a dynamic sql statement?
Is the primary key a clustered index?
If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?
List some fields from sqlca?
What is db2 instance?
What is a collection in db2?
Mention the downsides of page level lock.
What is null in db2?
How does cobol compile db2 program?
what are bind concepts in db2 cobol?
Which isolation level provides highest data integrity?
What is catalog database in db2?
What is host variable?
Is ibm db2 open source?