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 Runstats? Whem will u choose to runatats?
What is plan in cobol db2?
List out the buffer pools in db2
we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?
can we update the table by using cursors can anyone post the query?
Where can you declare a cursor in a cobol-db2 program?
What is DYNSLT keyword? How do you perform selection using DYNSLT
what is the difference between where clause and having clause
Under what circumstances will DB2 allow an SQL statement to update more than one primary key value at a time?
when we are tying to update a table having 100 rows. if the program abends when updating 51 row . how to start updating again from the 51 row .what was the logic
How many databases are there?
what is the certification that has a good value for a practioner in mainframes but not habving much knowledge on db2 related stuff?