Skip to main content

Categories: Binary

BIT_LENGTH

Returns the length of the bits of the input expression.

Syntax

BIT_LENGTH(expression binary, varchar) → integer

  • expression: A binary or varchar expression.

Examples

BIT_LENGTH example
SELECT BIT_LENGTH(1010)
-- 32
BIT_LENGTH example
SELECT BIT_LENGTH('DREMIO')
-- 48
BIT_LENGTH example
SELECT BIT_LENGTH('abc')
-- 24
BIT_LENGTH example
SELECT BIT_LENGTH(NULL)
-- null