ID EN
Bit Functions and Operators

&

MySQL 8.4

Bitwise AND.

Syntax

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

Examples

Example

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

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