Arithmetic operators in the MySQL database

Source: Internet
Author: User
Tags arithmetic arithmetic operators bitwise bitwise operators logical operators

Arithmetic operators in the MySQL database

Arithmetic operators in the MySQL database


First, an overview of the operators:

The operator is also an important knowledge body in the MySQL database, which is very useful for manipulating data when executing SQL statements. The use of these operators can help you save a lot of time, and more flexible operation.

Second, operator

Operators mainly include "arithmetic operator", "comparison operator", "Luo operator", "bitwise operator" Four categories, next we will learn a bit.

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/06/F7/wKiom1nBHnjRiJiaAAA-_uRmsFs021.jpg "title=" MySQL arithmetic operator. jpg "alt=" wkiom1nbhnjrijiaaaa-_urmsfs021.jpg "/>

1. Arithmetic operators

Arithmetic operators are used frequently in SQL statements, such as field operations on tables, and so on.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/06/F7/wKiom1nBHuLAt78AAAAsitkg64c307.jpg "title=" 1, Arithmetic operator. jpg "alt=" wkiom1nbhulat78aaaasitkg64c307.jpg "/>

2. Comparison operators

Comparing the tired operators is an important part, you need to focus on the parts of the tag

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/06/F7/wKiom1nBHyuyMPzsAACz_sJINqE267.jpg "title=" 2, comparison operator. jpg "alt=" wkiom1nbhyuympzsaacz_sjinqe267.jpg "/>

3. Logical operators

A logical operator is an operator that uses more frequently when manipulating table data and needs to focus

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/06/F7/wKiom1nBH4XgLpwEAABD6DktcGM072.jpg "title=" 3, logical operator. jpg "alt=" wkiom1nbh4xglpweaabd6dktcgm072.jpg "/>

4, bitwise operators

Bit operators are actually the data you can use when you intercept a query, and constantly splicing a lot of data.

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/06/F7/wKiom1nBH-HSCToZAABTgQTFh_w198.jpg "title=" 4, bitwise operator. jpg "alt=" wkiom1nbh-hsctozaabtgqtfh_w198.jpg "/>



Iv. finite levels of operators

Priority level that is, when there are 2 or more operators in a SQL, who takes precedence over the execution. This is also a very important part of the content.

Priority Level Operator
1 !
2 ~
3 ^
4 *,/, Div,%, mod
5 +,-
6 >>, <<
7 &
8 |
9

=, <=>, <, <=, >, >=,! =, <>, in, is, null, link, regexp

10 Between and, case, when, then, else
11 Not
12 &&, and
13 | |, or, and
14 :=


V. Concluding remarks:

Here we go. Specific operators, these operators in our subsequent SQL operations will be a great channel of help, through which we can accurately query to a field and so on. Learn well! Come on!


This article from "Lonely One Night" blog, reproduced please contact the author!

Arithmetic operators in the MySQL database

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.