Translation: SET Variable (submitted to the MariaDB official Manual), variablemariadb
This article is the official mariadb Manual: the translation of SET Variable.
Original article: https://mariadb.com/kb/en/set-variable/
Https://mariadb.com/kb/zh-cn/set-variable/ I submitted to the MariaDB official manual
Syntax
SET var_name = expr [, var_name = expr] ...
In stored programsSET
A statement is an extension of a Common SET statement. When a variable is referenced, it can reference a stored program, a global system variable, or a user-defined variable.
InSET
Statements are implemented as part of the existing SET syntax. This allows expansionSET a = x,b = y,...
Syntax, where different variable types can be mixed (local declared variables, global system variables and session system variables, User-Defined variables ). You can also combine local variables and some options that are meaningful only to system variables. In this case, although the options are identified, they are ignored.
SET
You can assign values to local variables and user-defined variables.
When assigning values to multiple variables by querying the returned column values, select into should be given priority.
You can use the LAST_VALUE () function to assign the same value to multiple variables ().
The following is an example of user-defined variable assignment:
SET @ x = 1; // The translator adds an example: SET assigns values to multiple types of variables. Note that when one of the variables fails to assign values, the entire statement fails. SET @ x = 1, SESSION SQL _mode = ''; SET GLOBAL sort_buffer_size = 1000000, SESSION sort_buffer_size = 1000000; SET @ global. sort_buffer_size = 1000000, @ local. sort_buffer_size = 1000000; set global max_connections = 1000, sort_buffer_size = 1000000;
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/8620767.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!