Update odd rows

IBM's flagship relational database management system

Update odd rows

Postby Naagju » Sat Mar 05, 2011 8:16 pm

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 ?
Posts: 16
Joined: Tue Feb 22, 2011 10:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Update odd rows

Postby Robert Sample » Sat Mar 05, 2011 8:26 pm

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.
Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Return to DB2


  • Related topics
    Last post