We have moved to www.dataGenX.net, Keep Learning with us.

Tuesday, December 30, 2014

Delete Duplicate Rows in DB2 Database


Many times and Many places, this question is being asked :-) that How to delete the duplicate row from a table in different DBs. Here, we will see How to do this in DB2 DB.

 
DELETE FROM
    (SELECT ROWNUMBER() OVER (PARTITION BY COL1, COL2, COL3) AS RNK
     FROM TABLE.NAME) AS A
WHERE RNK > 1;




Like the Facebook Page & join Group
https://www.facebook.com/DataStage4you
https://www.facebook.com/groups/DataStage4you

https://twitter.com/datastage4you
https://groups.google.com/d/forum/datastage4you
For WHATSAPP group , drop a msg to 91-88-00-906098


No comments :

Post a Comment