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 |
How many databases are there?
Explain the EXPLAIN statement?
Explain about cursor stability?
i have one file having 100 of records? i want to display it like 20 records in one column and 20 records in another column total 40 records per page ? how ?
I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.
0 Answers ITC Infotech, Syntel,
What information is contained in a SYSCOPY entry?
What is the difference between static and dynamic SQL?
What is a view? Why use it?
Can a unique index have more than one null value? If not, what error code is given if an attempt is made to insert more than one null value?
What is an access path?
Why cursor is used in db2?
What is db2 isolation?