Need Help With MySQL

Discussion in 'MySQL' started by zahidprimex, Dec 8, 2008.

  1. #1
    I want to change the value of a database colum to 0(zero).Which query should i use?Please help me.
     
    zahidprimex, Dec 8, 2008 IP
  2. mji2010

    mji2010 Active Member

    Messages:
    762
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #2
    do you mean the a single record's column value?

    UPDATE <table name>
    SET <column name> = <value>
    WHERE <column name> = <old value>;

    leave off the WHERE line if you want to set all values for the column to zero

    This works in T-SQL. I assume it will work in mysql.
     
    mji2010, Dec 8, 2008 IP
  3. diligenthost

    diligenthost Peon

    Messages:
    685
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #3
    We need more information to be able to churn out a query, like how the database tables etc. are set up, and how you identify the value you want to change.
     
    diligenthost, Dec 8, 2008 IP
  4. Ant-Lion

    Ant-Lion Well-Known Member

    Messages:
    164
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Yea, the syntax seems to be valid for MySQL so it should work for MySQL.
     
    Ant-Lion, Dec 9, 2008 IP
  5. zahidprimex

    zahidprimex Active Member

    Messages:
    123
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #5
    Thanks for your help.
     
    zahidprimex, Dec 9, 2008 IP