How to update or insert an empty column with empty string column and NULL column

Discussion in 'Databases' started by Julian_lock, May 12, 2011.

  1. #1
    Can some one tell me how am I need to insert/update info or data into an empty string column and column with null as I still in the process of learning MYsql.

    Any help would be appreciate :

    this is the sample :
    table name = product
    column consist = item code, description, prices, cost, category code.
    column values = 1234567 , whisky , 10.00, 8.00, "(empty column)" or "(NULL)".

    I would like to update/insert the category column with alphanumeric. and update to multiple row with the where clause.

    How am I to write the script?
     
    Julian_lock, May 12, 2011 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    I'm not sure what value you want to put in there.

    It would be something like:
    UPDATE product SET `category code` = 'SOME VALUE' WHERE `category code` IS NULL OR `category code` = '';
     
    jestep, May 12, 2011 IP
  3. Julian_lock

    Julian_lock Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank very very much jestep, this would make my work a lot more easier then edit 1 by 1.
    Thank again
     
    Julian_lock, May 12, 2011 IP