Translation: Value assignment operator (: =) (submitted to the MariaDB official Manual), operator mariadb

Source: Internet
Author: User

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!

Related Article

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.