Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Hyderabad
    Posts
    14

    Unanswered: Multiple updates

    Hi i have to update the column in a table based on values of 2 other columns. The values of the column are in XL sheet. there are around 1000 rows. how to update them with single statement.
    Ex:

    Col1 Col2 Col3

    Col2 is to be updated based on combination of co1 and col3.Column 1,column 2 are from one table and column3 is from another table. The values of col1,col2,col3 were sent in XL sheet and i loaded them into a staging table. now how to update them with single update statement.

    Thanks in advance.
    HK

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    I don't know why you keep mentioning an "XL sheet" - it has no bearing on the problem at all since you have the data in a table!

    It sounds like you just want to do (something like) this:

    update staging_table
    set col1 = col2*42 + col3/11;

    (But I've probably misunderstood the question.)

  3. #3
    Join Date
    Apr 2003
    Location
    Jagdishpur
    Posts
    146
    Hi,
    I do agree with Tony...but i don't think if at all this has any issue...at least it looks like...and may be..i also might hv understood it wrong.
    .
    If you hv a staging_table having three columns...c1, c2, c3...Sofrom hwere they came is not more pertinent now...
    and i feel u need to do an update of 2nd column based on using values of 1st & 3rd column for each rows...Is it.? If yes, then this is just a simple update command....what is the question of Single Update....this is not clear..
    It could be like this....
    update staging_table
    set c2 = c1 + c3
    /
    ...Will not it work....if i understood the issue correctly..

    Regards,
    Kamesh Rastogi
    - KR

Posting Permissions

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