db--operator

Source: Internet
Author: User

1. Arithmetic operators

    • +,
    • -,
    • *
    • /, DIV,
    • %, MOD
    • In division and modulo operations, if the divisor is 0, it will be an illegal divisor and the return result is null

2. Comparison operators

    • =
    • <>! =
    • <=>//null security Equals (Null-safe)
    • <
    • <=
    • >
    • >=
    • Between//x between A and B-a <= x <= b
    • Inch
    • Is NULL
    • is not NULL
    • Like
    • REGEXP, rlike//string REGEXP String_pat returns 1 when string string contains string_pat-matched strings
    • MySQL allows the user to compare the left and right operands of an expression, return 1 if the result is true, return 0 for false, and return NULL if the comparison result is indeterminate
    • Comparison operators can be used to compare numbers, strings, and expressions. Numbers are compared as floats, and strings are compared in a case-insensitive manner.
    • Null cannot be compared with =.
    • <=> and = similar, 1 when the operands are equal, except that the value of a timely operation is null and can be correctly compared.

3. Logical operators

    • Not,!

Not NULL return value is NULL

    • And, &&

When all operands are non-0 values and are NOT NULL, the computed result is 1, when 1 or more operands are 0 o'clock, the result is 0, any one of the operands is null and the return value is null

    • OR, | |

When the two operands are all non-null values, if either operand is a non-0 value, the result is 1, otherwise the result is 0. When there is an operand of NULL, if the other operand is a non-0 value, the result is 1, otherwise null. Two operands are null, the resulting result is null.

    • XOR//different or

When either operand is null, the return value is null, and for non-null operands, if the two logical false values are different, the result 1 is returned, otherwise 0

db--operator

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.