The operators in MySQL

Source: Internet
Author: User

Arithmetic operators, comparison operators, logical operators, bitwise operators

1. Arithmetic Operators

The arithmetic operators supported by MySQL include subtraction and modulo operations.

Note: 0 cannot be removed; modulo: 3%2 and mod (3,2) effect.

2. comparison Operators

<=> and = similar, the operands have an equal value of 1, but the difference is that even if the values of the operations are null, they can be compared correctly.

The REGEXP operator is used in the format: "Str REGEXP str_pat", when the str string contains a string that matches Str_pat, the return value is 1.

3. logical Operators

A logical operator, also known as a Boolean operator, is used to confirm the authenticity of an expression.

And or &&: When all operands are not 0 values and are not NULL, the result is 1;

OR OR | | : When two operands are non-null values, if any one operand is a non-0 value, the result is 1, otherwise 0;

XOR: The return value is null when either operand is null. For non-null operands, if the logical false value of two is different, return 1, otherwise return 0.

4. Bitwise Operators

Bitwise operation when the given operand into a binary, each operand of each bit of the specified logical operation, the resulting binary result is converted to decimal is the result of the bit operation.

Precedence of Operators

The operators in MySQL

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.