top of page




Bitwise AND.

The result type depends on whether the arguments are evaluated as
binary strings or numbers:

o Binary-string evaluation occurs when the arguments have a binary
string type, and at least one of them is not a hexadecimal literal,
bit literal, or NULL literal. Numeric evaluation occurs otherwise,
with argument conversion to unsigned 64-bit integers as necessary.

o Binary-string evaluation produces a binary string of the same length
as the arguments. If the arguments have unequal lengths, an
.html#error_er_invalid_bitwise_operands_size) error occurs. Numeric
evaluation produces an unsigned 64-bit integer.

For more information, see the introductory discussion in this section.



mysql> SELECT 29 & 15;
-> 13
mysql> SELECT HEX(_binary X'FF' & b'11110000');
-> 'F0'

bottom of page