Home >Database >Mysql Tutorial >How to write sql modification statement

How to write sql modification statement

王林
王林Original
2020-06-16 09:04:198026browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn