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

How to do this selective update?


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

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Sat Oct 27, 2007 12:04 am
Reply with quote

Key1 Key2 Month Indication Description
A1 B1 2 N Aaaaaaaaaaa
A1 B1 3 J Bbbbbbbb
A1 B1 4 N Cccccccccccc
A1 B1 5 J Dddddddddd
A2 B2 2 J Eeeeeeeeeeee
A2 B2 3 J fffffffffffffff

I have this table.
For each key I have to search the record with the lowest month and indication J. From there on I have to change records. That means for key A1-B1 that I have to change the records for month 3, 4 and 5. Changing has to start with 3, then 4 and then 5.
For key A2-B2 I have to change both records, because the lowest month 2 has indication J

How do I programme this?? Correlated subquery? How then?? Please heldp.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Oct 27, 2007 12:45 am
Reply with quote

Hello revdpoel and welcome to the forums,

If you use a meaningful subject, you will get more and better responses.

Your subject will not attract so many viewers. "Please help me solve this" provides no hint of the actual question.

I'll change the subject and you can post a reply if you prefer a different subject - you know your requirement better than i do icon_smile.gif
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Sat Oct 27, 2007 12:52 am
Reply with quote

Thanks Dick
title is allright
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 Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
No new posts Selective extract of multi-record-typ... SYNCSORT 4
No new posts DB2 SQL query to read and update data... DB2 12
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
Search our Forums:

Back to Top