BITSHIFTRIGHT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Bitwise expression functions

Shifts the bits for a numeric or binary expression n positions to the right.

Syntax

BITSHIFTRIGHT( <expr1> , <n> )

Parameters

NameRequiredDescription
expr1requiredThis expression must evaluate to an INTEGER value, a BINARY value, or a value of a data type that can be cast to an INTEGER value.
nrequiredThe number of bits to shift by.

Returns

Returns an INTEGER value, a BINARY value, or NULL: - When the input expression contains an INTEGER value, returns a signed 128-bit (16-byte) integer, regardless of the size or data type of the input data value. - When the input expression contains a BINARY value, returns a BINARY value. - If any argument is NULL, returns NULL.

Usage notes

See also

Referenced by