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 NULL return value is NULL
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
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.
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