Translation: assignment operator (: =) (submitted to MARIADB official manual)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.