>>
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
Bitwise right shift.
USAGE
number >> count
Value Name | Description |
---|---|
| The starting number |
| The number of bit positions to shift to the right |
DETAILS
The >>
operator returns the starting number
after shifting the bits rightward count
bit positions.
A NULL
is returned if either value is NULL
.
The expression x >> y
behaves in exactly the same manner as the function call SHIFTR(x, y)
.
EXAMPLES
SELECT 5 >> 1, 5 >> 2, 5 >> 3;
+--------+--------+--------+
| 5 >> 1 | 5 >> 2 | 5 >> 3 |
+--------+--------+--------+
| 2 | 1 | 0 |
+--------+--------+--------+