Translation: Value assignment operator (: =) (submitted to the MariaDB official Manual), operator mariadb
This article is a translation of the value assignment operator (: =) in the mariadb official manual.
Original article: https://mariadb.com/kb/en/assignment-operator/
Https://mariadb.com/kb/zh-cn/assignment-operator/ I submitted to the MariaDB official manual
Syntax
var_name := expr
Description
The value assignment operator is used to assign values to a variable. The value on the right of the operator is assigned to the variable on the left of the operator.
Unlike the = Operator, the: = operator can always be used to assign values to variables. (Note: "=" cannot be used to assign values when using the select statement ).
This operator can assign values to user-defined variables and local variables.
When you want to assign values to multiple variables with the same value, you can use the LAST_VALUE () function.
Example
SELECT @x := 10;+----------+| @x := 10 |+----------+| 10 |+----------+SELECT @x, @y := @x;+------+----------+| @x | @y := @x |+------+----------+| 10 | 10 |+------+----------+
Back to Linux series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html
Back to website architecture series article outline: http://www.cnblogs.com/f-ck-need-u/p/7576137.html
Back to database series article outline: http://www.cnblogs.com/f-ck-need-u/p/7586194.html
Reprinted please indicate the source: http://www.cnblogs.com/f-ck-need-u/p/8615916.html
Note: If you think this article is not bad, please click the recommendation in the lower right corner. Your support can stimulate the author's enthusiasm for writing. Thank you very much!