Home >Database >Mysql Tutorial >How to write sql modification statement
sql update statement writing:
UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value;
Note:
The WHERE clause specifies which record or records need to be updated . If you omit the WHERE clause, all records will be updated!
In MySQL, you can solve this problem by setting the built-in parameter sql_safe_updates
. When this parameter is turned on, you must carry the where condition after the update statement. Otherwise, an error will be reported.
Opening method:
set sql_safe_updates=1; 表示开启该参数
Recommended tutorial: mysql tutorial
The above is the detailed content of How to write sql modification statement. For more information, please follow other related articles on the PHP Chinese website!