What is the SQL query to select, delete and get count of
duplicate rows in DB2?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / hkhatri27
SELECT Columns
FROM Table
GROUP BY Columns
HAVING COUNT(*) > 1;
~ Himanshu
| Is This Answer Correct ? | 2 Yes | 2 No |
List down the types of triggers in the db2 database?
What is meant by index cardinality?
What is a collection?
Explain about cursor stability?
Explain correlated sub-queries.
What is the difference between nvl and coalesce?
What is the result of open cursor statement?
Define sqlca.
What are foreign keys in db2?
How do I start db2 in windows?
What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.How can I solve it without using a cursor.
4 Answers Cap Gemini, Verizon,
What is reorg and runstats in db2?