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] .
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 列名称 = 某值
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.
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!