Update table from same table

  • Hi all,

    Beginners question so please forgive me

    I have a table with 5000 rows of data and I want to update one field with the values of two other fields in the same table.

    Example

    ID

    value1

    value2

    value3

    finalvalue

    So finalvalue = value1/value2*value3

    How do I accomplish this ?

    Many thanks for any help

    Gina

  • is this what you require?

    if this gives you the desired results

    SELECT

    ID

    , value1

    , value2

    , value3

    , value1 / value2 * value3 AS finalvaluetest

    FROM yourtable

    then

    UPDATE yourtable

    SET finalvalue = value1 / value2 * value3

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

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

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