The UPDATE statement is widely used in databases and one of the most common SQL statements. The following describes how to use the mysql UPDATE statement for your reference.
Mysql UPDATE statement for a single table:
UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
SET col_name1 = expr1 [, col_name2 = expr2...]
[WHERE where_definition]
[Order by...]
[LIMIT row_count]
Mysql UPDATE statements for multiple tables:
UPDATE [LOW_PRIORITY] [IGNORE] table_references
SET col_name1 = expr1 [, col_name2 = expr2...]
[WHERE where_definition]
The UPDATE syntax uses the new value to UPDATE columns in the original table rows. The SET clause indicates the columns to be modified and the values to be given. The WHERE clause specifies the rows to be updated. If there is no WHERE clause, all rows are updated. If the order by clause is specified, the row is updated in the specified ORDER. The LIMIT clause is used to specify a LIMIT to LIMIT the number of rows that can be updated.
The mysql UPDATE Statement supports the following modifiers:
· If you use the LOW_PRIORITY keyword, the UPDATE execution is delayed until no other clients read from the table.
· If you use the IGNORE keyword, the update statement will not be interrupted even if an error occurs during the update process. If duplicate keyword conflicts occur, these rows are not updated. If the column is updated, the new value will cause data conversion errors, and these rows will be updated to the closest legal value.
How to Set auto-increment fields in MySQL
Mysql inserts an instance of the Clob Field
Default length of common MySql Fields
Length of int data type in mysql
General INSERT usage in MySQL