BITWISE_SHIFT_LEFT()

All functions > BITWISE > BITWISE_SHIFT_LEFT()

Returns the bitstring shifted left by N positions, filling with zeros on the right.

Signatures

Returns: Shifted bitstring, or NULL if either operand is NULL

BITWISE_SHIFT_LEFT(expr: BITSTRING, n: BIGINT) → BITSTRING
sql
ParameterTypeRequiredDescription
exprBITSTRINGYesInput bitstring
nBIGINTYesNumber of bit positions to shift

Notes

  • Bits shifted beyond the left end are discarded
  • New bits on the right are filled with zeros
  • The length of the result is the same as the input
  • Returns NULL if either input is NULL

Related operators

Examples

FeatureQL
SELECT
    f1 := BITWISE_SHIFT_LEFT('1001011'::BITSTRING, 3)::VARCHAR -- Shift left by 3
;
Result
f1 VARCHAR
1011000

Last update at: 2026/05/26 17:22:09