Not very familiar with SQL, need to replace data in column

Discussion in 'MySQL' started by marcusa007, Dec 23, 2010.

  1. #1
    I have a table that has a column with the option weight for all products that is set to 0.00000 and I want to change them all to 0.5

    What would the correct command be?

    Thanks for the help.
     
    marcusa007, Dec 23, 2010 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Use the following UPDATE query
    UPDATE table_name SET 
    column_name = 0.5
    Code (markup):
    To be on safe side backup your data before running this query
     
    mwasif, Dec 24, 2010 IP
  3. marcusa007

    marcusa007 Active Member

    Messages:
    312
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Thanks that worked great.
     
    marcusa007, Dec 24, 2010 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    you are welcome
     
    mwasif, Dec 24, 2010 IP