This document is the official manual of Mariadb: The translation of the assignment operator (: =).
Original:https://mariadb.com/kb/en/assignment-operator/
I submit it to MARIADB official manual:https://mariadb.com/kb/zh-cn/assignment-operator/
Grammar
var_name := expr
Describe
The assignment operator is used to assign a value to a variable. The value to the right of the operator is assigned to the variable to the left of the operator.
Unlike the = operator, the = operator can always be used to assign a value to a variable. (Translator Note: You cannot use "=" To assign a value when using a SELECT statement).
The operator can assign a value to the user-defined variable user-defined variables and local variables locally variables .
You can consider using the last_value () function when you want to assign values of the same value to multiple variables.
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 Site 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
Reprint Please specify source: http://www.cnblogs.com/f-ck-need-u/p/8615916.html
Note: If you think this article is not bad please click on the lower right corner of the recommendation, your support can inspire the author more enthusiasm for writing, thank you very much!
Translation: assignment operator (: =) (submitted to MARIADB official manual)