Page 1 of 1

Update odd rows

PostPosted: Sat Mar 05, 2011 8:16 pm
by Naagju
suppose in my table 100 rows are there , i want to update odd rows salary as 90000 ? how u do it ? what do we use here cursor-fetch or normal sql ?

Re: Update odd rows

PostPosted: Sat Mar 05, 2011 8:26 pm
by Robert Sample
What are you calling an "odd row"? Considering that, without an ORDER BY, the same query can return the results in different order each time you run it? Have you got a row number defined on the table? If not, you need to either give up on the idea of doing this, or you need to clearly define under which circumstances a row will be "odd" since DB2 doesn't do so.