IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

remove duplicate in db2 throu sql and reatin only one column


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Thu Mar 18, 2010 11:41 am
Reply with quote

I donno if u r looking for a solution or trying to dig up DB2.
Y dont u use a serial cursor with ORDER BY clause on all the columns with a FOR UPDATE OF clause.

Fetch first row and store the entire row in W-S.
Fetch NEXT compare it with W-S.
If equal DELETE CURRENT OF cursor.
If different move it to W-S.

Run a one time BMP like this and declare an index on all the columns to be unique to avoid duplications in future.

Thanks,
Manikanth
P.S: Do I make sense or Is my solution useless?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top