ID EN
Bit Functions and Operators

>>

MySQL 8.4

Shifts a longlong (BIGINT) number or binary string to the right.

Syntax

MYSQL
SELECT 4 >> 2;
1
SELECT HEX(_binary X'00FF00FF00FF' >> 8);
'0000FF00FF00'

Examples

Example

The result type depends on whether the bit argument is evaluated as a binary string or number:

MYSQL
SELECT 4 >> 2;
1
SELECT HEX(_binary X'00FF00FF00FF' >> 8);
'0000FF00FF00'