Home > Database > Mysql Tutorial > body text

How to write sql modification statement

王林
Release: 2020-06-16 09:04:19
Original
7992 people have browsed it

How to write sql modification statement

sql update statement writing:

UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
Copy after login

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; 表示开启该参数
Copy after login

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!

Related labels:
sql
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template