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 |
select distinct(empid),distinct(dept),name from EMP will the above query work?
What are packages in db2?
In db2, how do you insert multiple rows in 1 query using a.) Cursors, b.) Normal query?? Give syntax for both.
If I have 5 Queries in a DB2 Cobol program , while precompiling how many DBRMs will get created and How many Plans and Packages will get created while Bind Process?
If the base table underlying a view is restructured, eg. attributes are added, does the application code accessing the view need to be redone?
Q3. How will you fetch duplicate values from a DB2 table?
How do you insert a record with a nullable column?
What is the role of schema in the db2 database?
Explain about open switch business continuity software?
Are views updateable?
What is syscat in db2?
What is db2 plan table?