mysql – setting multiple column using one update

The Question :

204 people think this question is useful

How to set multiple columns of a table using update query in mysql?

The Question Comments :

The Answer 1

352 people think this answer is useful

Just add parameters, split by comma:

UPDATE tablename SET column1 = "value1", column2 = "value2" ....

See also: mySQL manual on UPDATE

The Answer 2

64 people think this answer is useful
UPDATE some_table 
   SET this_column=x, that_column=y 
   WHERE something LIKE 'them'

Tags:

Add a Comment