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 |
What is performance tuning db2?
What is the error code -803 ?
Suppose we are doing transaction in a table and abend happened in between. Suppose i have completed the transaction upto X rows and I want to start the transaction again where the abend happened. I don't want to do the transaction from the first record. Then what i have to do.
Which command is used to remove all rows from a table?
What is the use of reorg in db2?
What is a db2 collection?
What is package in db2 mainframe?
Normalization in DB2 – first normal form, second normal form
When reorg is used?
What is runstats and reorg in db2?
What is the SQL Communications Area and what are some of its key fields?
What is meant by a unit of recovery?