The sql command to update records is UPDATE. The UPDATE command is used to modify or update data in mysql. This command can update one or more fields at the same time, and can also specify any conditions in the WHERE clause.
#sql command to update records is UPDATE.
(Recommended learning: mysql tutorial)
Syntax:
The following is the general SQL syntax for the UPDATE command to modify MySQL data table data:
UPDATE table_name SET field1=new-value1, field2=new-value2 [WHERE Clause]
You can update one or more fields at the same time.
You can specify any condition in the WHERE clause.
You can update data simultaneously in a single table.
Example:
mysql> UPDATE tbl SET title='学习 C++' WHERE id=3; Query OK, 1 rows affected (0.01 sec)
The above is the detailed content of What is the command to update records in sql. For more information, please follow other related articles on the PHP Chinese website!