Results 1 to 3 of 3

Thread: updating tables

  1. #1
    Join Date
    Sep 2005

    Unanswered: updating tables

    Hi Experts,
    i have a small problem...i wanted to update a table...the table has the following attributes with some values:
    ID, prefix_name, price, zones,period_id
    1 , ABC , 1 , 20, PEAK
    2, ABC, 1 ,20 , PEAK
    3, DEF, 1, 30, PEAK
    4, GHI, 1, 40, OFF-PEAK
    Now my question is that when the value of price (as in my case all 4) and the value of period_id (first three in my case), is same then they should update the table with the same zones...i mean it shouldnt show 20 , 20 , 30 ,40....instead it should be showing 20,20,20 and then 40 (since for the last row the value of period_id is different)
    can anyone suggest me how to do that??
    any help will be greatly appreciated.

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    Why (20, 20, 20, 40) and not (30, 30, 30, 40)? Those would also be the same, wouldn't they?

    I mean: how will you (or someone of the rest of us) know WHICH zone to take? Minimum? Maximum? First (regarding some order)?

  3. #3
    Join Date
    Sep 2005
    Thanks a lot for all the reply,
    i want to update the ZONES column...(price is 1,as u can see there)...and i have to update the zones column with the same values,may be updating it with some new shouldnt be 20 or 30 anymore...i can make a sequence to update the zones column...but the condition for updating the zones column is that it should be grouped according to the price and period_id...i.e. when the price for some rows is 1 and the period_id is peak then it should have some value for zones (but the 20 or 40...but all the rows should be updated with this value)...
    i hope now i made it clearer...
    thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts