As shown on the left, there are two syntaxes for the UPDATE statement. Explanations of each and examples are provided in these documentation pages:
If you want to change data in a table or just in some rows—even one row only—use this MySQL statement. Click on the heading here for more details.
hits past month: 13 ; last updated: may 4, 2009 - 2:34am ; parent: Data Manipulation StatementsUPDATE [LOW_PRIORITY] [IGNORE] table
SET column=expression[, ...]
[WHERE condition]
[ORDER BY {column|expression|position}[ASC|DESC], ...]
[LIMIT {[offset,] count|count OFFSET offset}]
UPDATE [LOW_PRIORITY] [IGNORE] table_reference
SET column=expression[, ...]
[WHERE condition]
This statement changes existing rows of data in a table. The first syntax shown updates only one table per statement (see UPDATE a Single Table). The second syntax can be used to update or reference data in multiple tables from one statement (see UPDATE Multiple Tables). Explanations of both types of statements and examples of their use follow.