BIT_LENGTH

Gets length of bits of the input expression.

Syntax

BIT_LENGTH(expression BINARY, VARCHAR) → BINARY

  • expression: A binary or varchar expression

Examples

BIT_LENGTH example
SELECT BIT_LENGTH(1010)
-- 32
BIT_LENGTH example
SELECT BIT_LENGTH('SPICE')
-- 48
BIT_LENGTH example
SELECT BIT_LENGTH('abc')
-- 24
BIT_LENGTH example
SELECT BIT_LENGTH(NULL)
-- None

Last updated