MySQL
SQL operators
SQL has three types of operators, namely arithmetic operators, logical operators and comparison operators.
Arithmetic Operators
Operator | use | usage | result |
---|---|---|---|
+ | addition | 1 + 2 | 3 |
- | Subtraction | 5-4 | 1 |
* | multiplication | 6 * 6 | 36 |
/ | quotient | 8/5 | 1.6 |
% | remainder | 8% 5 | 3 |
Logical Operators
Operator | Semantics |
---|---|
AND | And |
OR | or |
NOT | non- |
Comparison Operators (Comparison Operators)
Operator | Semantics | usage | result |
---|---|---|---|
< | Less than | 3 <5 | True |
> | more than the | 8> 1 | True |
<= | Less than or equal to | 20 <= 10 | False |
>= | greater or equal to | 4 >= 6 | False |
= | equal | 2 = 2 | True |
<> | not equal to | 7 <> 6 | True |
BETWEEN | Within a certain range | ||
LIKE | Meet the model conditions | ||
IN | The value exists in the IN collection | |
Post a Comment
0 Comments