SQL Operators(运算符)

概述

参考:

运算符描述Introduced弃用版本
&Bitwise AND
>Greater than operator
»Right shift
>=Greater than or equal operator
<Less than operator
<>,!=Not equal operator
«Left shift
<=Less than or equal operator
<=>NULL-safe equal to operator
%,MODModulo operator
*Multiplication operator
+Addition operator
-Minus operator
-Change the sign of the argument
->Return value from JSON column after evaluating path; equivalent to JSON_EXTRACT().
Return value from JSON column after evaluating path and unquoting the result; equivalent to JSON_UNQUOTE(JSON_EXTRACT()).
/Division operator
:=变量赋值
=变量赋值(作为 SET 语句的一部分,或作为 UPDATE 语句中 SET 子句的一部分)
=Equal operator
^Bitwise XOR
AND,&&Logical AND
BETWEEN … AND …Whether a value is within a range of values
BINARYCast a string to a binary string8.0.27
CASECase operator
DIVInteger division
IN()Whether a value is within a set of values
ISTest a value against a boolean
IS NOTTest a value against a boolean
IS NOT NULLNOT NULL value test
IS NULLNULL value test
LIKESimple pattern matching
MEMBER OF()Returns true (1) if first operand matches any element of JSON array passed as second operand, otherwise returns false (0)8.0.17
NOT,!Negates value
NOT BETWEEN … AND …Whether a value is not within a range of values
NOT IN()Whether a value is not within a set of values
NOT LIKENegation of simple pattern matching
NOT REGEXPNegation of REGEXP
[OR,](https://dev.mysql.com/doc/refman/8.0/en/logical-operators.html#operator_or)Logical OR
REGEXPWhether string matches regular expression
RLIKEWhether string matches regular expression
SOUNDS LIKECompare sounds
XORLogical XOR
[](https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html#operator_bitwise-or)Bitwise OR
~Bitwise inversion