Home > Database > Mysql Tutorial > What does set mean in mysql?

What does set mean in mysql?

藏色散人
Release: 2020-10-13 10:39:30
Original
27686 people have browsed it

SET in mysql is a way to assign values ​​to defined variables in SQL Server. It is often used together with the update statement. Its usage syntax is [UPDATE table name SET column name = new value WHERE column name = certain value] .

What does set mean in mysql?

SET is a way of assigning values ​​to defined variables in SQL Server and is often used together with the update statement.

Syntax:

UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值
Copy after login

Note:

There are two ways to assign values ​​to defined variables in SQL Server, namely SET and SELECT. For these two methods The differences are as follows:

1. There are differences when assigning values ​​to multiple variables at the same time:

set does not support assigning values ​​to multiple variables.

select supports assignment to multiple variables.

2. There is a difference when an expression returns multiple values:

set will make an error when it returns multiple values ​​for an expression

select returns multiple values ​​for an expression when the result is returned to the last value assigned to the variable.

3. There is a difference when the expression does not return a value:

set When the expression does not return a value, the variable is assigned a null value.

select When the expression does not return a value, the variable retains its original value.

What does set mean in mysql?

Related recommendations: "MySQL Tutorial"

The above is the detailed content of What does set mean in mysql?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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