Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the SQL query to select, delete and get count of
duplicate rows in DB2?

Answers were Sorted based on User's Feedback



What is the SQL query to select, delete and get count of duplicate rows in DB2?..

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

What is the SQL query to select, delete and get count of duplicate rows in DB2?..

Answer / hkhatri27

SELECT Columns
FROM Table
GROUP BY Columns
HAVING COUNT(*) > 1;

~ Himanshu

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More DB2 Interview Questions

What is the cascade rule and how does it relate to deletions made with a subselect?

1 Answers  


How can you split a table in to exactly half?

7 Answers   HSBC,


What is null in db2?

0 Answers  


Where besides the DB2 catalog is database object information stored by DB2?

1 Answers  


What are some characteristics of columns that benefit from indexes?

1 Answers  


What is dbrm? What it contains? When it will be created?

0 Answers  


what are the max. & min. no. of partitions allowed in a partition tablespace?

2 Answers   IBM,


can we view the access paths created by dbrm ? how ? thx

2 Answers   IBM,


Can DASD types assigned to storage groups be intermixed (i.e., 3350s and 3380s)?

1 Answers  


how to resolve -818 error. how to see timestamp token in load module and plan

4 Answers   IBM,


how to resolve -805. give clear explination for that

2 Answers   IBM,


I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.

0 Answers  


Categories