Sequentially update a column with a decrementing value

  • I want to update the "QTY_REQ" column in the PLSQL table in the screen cap below sequentially row by row by dividing out a number (e.g. 7) among the rows. I want to start with the row with the highest value in QTY (QTY 4, LOC 10800B41) and enter 4 for QTY_REQ. Then go to the second row (QTY 2, LOC 10800A01) and enter 2 for QTY_REQ. Then finally go to the third row (QTY 2, LOC 10800B01) and enter 1 for QTY_REQ. So I evenly divide out the values and stop when the total is reached. The number could be 5 and would just fill in the first two rows (4 entered for for QTY_REQ for the first and 1 entered for for QTY_REQ for the second) Important point; the value that is entered for QTY_REQ cannot be higher than the value that is in the QTY column for that row.

    If someone can help with this that would be appreciated, thank you.

    Attachments:
    You must be logged in to view attached files.
  • Apologies for the duplicate post

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply