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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you find the maximum value in a column in db2?

1108


What is a buffer in memory?

1065


How do I change the column size in db2?

1161


Which component is used to execute the sql statements?

1104


How do you stop a db2 database in linux?

1020


What are packages in db2?

1027


What are db2 tables?

1131


What is phantom read in db2?

1166


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

1187


How do you simulate the explain of an embedded sql statement in spufi/qmf?

1092


What are iseries servers?

1081


Who uses db2?

1056


How to run db2 command in windows?

1200


What is an instance database?

1059


What is the function of logging in the db2 database?

1124