GETBIT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Bitwise expression functions

Given an INTEGER value, returns the value of a bit at a specified position.

Syntax

GETBIT( <integer_expr>, <bit_position> )

Parameters

NameRequiredDescription
integer_exprrequiredThis expression must evaluate to a data type that can be cast to an INTEGER value.
bit_positionrequiredThe position of the bit (starting from 0 for the least significant bit up to 127 for the most significant bit) for which to retrieve the value.

Returns

The function returns the value of the bit (0 or 1) at the specified position.