<<
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 left shift.
USAGE
number << count
Value Name | Description |
---|---|
| The starting number |
| The number of bit positions to shift to the left |
DETAILS
The <<
operator returns the starting number
after shifting the bits leftward 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 SHIFTL(x, y)
.
EXAMPLES
SELECT 1 << 0, 1 << 1, 3 << 2;
+--------+--------+--------+
| 1 << 0 | 1 << 1 | 3 << 2 |
+--------+--------+--------+
| 1 | 2 | 12 |
+--------+--------+--------+