Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
remove duplicate in db2 throu sql and reatin only one column
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: @Santosh
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To remove the spaces using SORT Card dharmaraok DFSORT/ICETOOL 1 Tue Apr 30, 2019 3:42 pm
No new posts Remove selected duplicate rows from t... hnharish DFSORT/ICETOOL 3 Wed Sep 05, 2018 3:11 am
No new posts CLOB Column data to External File usi... lalitmehta12 DB2 9 Tue Aug 21, 2018 7:22 pm
This topic is locked: you cannot edit posts or make replies. remove the gap b/w 2 fields shymala COBOL Programming 5 Thu Aug 02, 2018 12:05 pm
This topic is locked: you cannot edit posts or make replies. I need to remove low values in my field shymala COBOL Programming 8 Sun Jul 29, 2018 11:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us