Skip to main content
Scalar function
Returns NULL when an argument is NULL.

Syntax

Scalar

Arguments

Returns

  • Type: INT for TINYINT, SMALLINT and INT input; BIGINT for BIGINT input
  • Possible values: The shifted integer, using its converted 32-bit or 64-bit type.
  • NULL behavior: Returns NULL when an argument is NULL.

Properties

Usage notes

  • The shift amount is normalized modulo the integer width. Negative and large amounts wrap into the range 0 through width - 1.
  • TINYINT and SMALLINT inputs are promoted to INT.

Examples

Shift and NULL input

Shift a positive integer value

Limitations

  • TINYINT and SMALLINT inputs produce INTEGER results. Query tools may still report the input type. Use INTEGER or BIGINT inputs to avoid this mismatch.
Last modified on October 15, 2026