MySQL (Part 5) and mysql (Part 5)

Source: Internet
Author: User

MySQL (Part 5) and mysql (Part 5)
Common operators 1. Arithmetic Operators

Operator

Function

+

Addition operation

-

Subtraction

*

Multiplication

/

Division

%

Remainder operation

2. Comparison Operators

Operator

Function

=

Equal

<=>

Security equals. Can be used to determine NULL

<>! =

Not equal

<=

Less than or equal

> =

Greater than or equal

IS NULL

Empty or not

IS NOT NULL

Not empty

LEAST

Returns the minimum value.

GRETEST

Maximum Value

BETWEEN AND

Between two values

ISNULL

Equivalent to IS NULL

IN

Determines whether a value is any value IN the IN column.

NOT IN

Judge that a value is not any value IN the IN column.

LIKE

Wildcard match

REGEXP

Regular Expression

 

3. logical operators

Operator

Function

AND or &&

Logic and

NOT or!

Non-logical

OR |

Logic or

XOR

Logic exclusive or

NOT or!

It indicates that when the operand is 0, the obtained value is 1. When the operand is not 0, the obtained value is 0. When the operand is NULL, the returned value is NULL.

 

 

AND or &&

Logic AND operator AND or & indicates that when all operands are non-zero values AND not NULL, the calculation result is 1. When one or more operands are 0, the result is 0, and the return value is NULL in other cases.

 

 

 

 

OR |

Logical OR operator OR | indicates that if both operands are non-NULL values and any operand is non-zero, 1 is returned; otherwise, 0 is returned; when one operand is NULL and the other operand is non-zero, the result is 1; otherwise, the result is NULL. When both operands are NULL, the result is NULL.

 

 

 

XOR

Logical XOR operator (XOR. If any operand is NULL, NULL is returned. For non-NULL operands, if both operands are non-0 or both are 0 values, 0 is returned. If a value is 0, if the other value is non-zero, 1 is returned.




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.