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
GROUP BY Columns
HAVING COUNT(*) > 1;
|Is This Answer Correct ?||2 Yes||2 No|
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.
What is meant by dclgen?
What is the difference between db2 and oracle?
What is cursor?
What is database alias db2?
What is catalog database in db2?
When do you use the IMAGECOPY?
Mention the various locks that are available in db2.
What is drop table?
How can we define a table? How can we apply SEARCH ALL on it ?
Outputs of explain are with matchcols = 0. What does this signify?
What are the contents of a DCLGEN?