This documentation is for an older version. If you're using the most current version, select the documentation for that version with the version switch in the upper right corner of the online documentation, or by downloading a newer PDF or EPUB file.

## 12.3 Operators

12.3.1 Operator Precedence
12.3.2 Comparison Functions and Operators
12.3.3 Logical Operators
12.3.4 Assignment Operators

Table 12.2 Operators

NameDescription
`AND`, `&&` Logical AND
`=` Assign a value (as part of a `SET` statement, or as part of the `SET` clause in an `UPDATE` statement)
`:=` Assign a value
`BETWEEN ... AND ...` Check whether a value is within a range of values
`BINARY` Cast a string to a binary string
`&` Bitwise AND
`~` Bitwise inversion
`|` Bitwise OR
`^` Bitwise XOR
`CASE` Case operator
`DIV` Integer division
`/` Division operator
`<=>` NULL-safe equal to operator
`=` Equal operator
`>=` Greater than or equal operator
`>` Greater than operator
`IS NOT NULL` NOT NULL value test
`IS NOT` Test a value against a boolean
`IS NULL` NULL value test
`IS` Test a value against a boolean
`<<` Left shift
`<=` Less than or equal operator
`<` Less than operator
`LIKE` Simple pattern matching
`-` Minus operator
`%`, `MOD` Modulo operator
`NOT BETWEEN ... AND ...` Check whether a value is not within a range of values
`!=`, `<>` Not equal operator
`NOT LIKE` Negation of simple pattern matching
`NOT REGEXP` Negation of REGEXP
`NOT`, `!` Negates value
`||`, `OR` Logical OR
`+` Addition operator
`REGEXP` Pattern matching using regular expressions
`>>` Right shift
`RLIKE` Synonym for REGEXP
`SOUNDS LIKE` Compare sounds
`*` Multiplication operator
`-` Change the sign of the argument
`XOR` Logical XOR