On this page

    Categories: Binary

    BIT_LENGTH

    Gets length of bits of the input expression

    Syntax

    BIT_LENGTH(expression BINARY, VARCHAR) → BINARY

    • expression: A binary or varchar expression

    Examples

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