BIT_LENGTH()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
Returns the length of the given string argument in bits.
EXAMPLES
CREATE TABLE bitlen_example (
example BIGINT
);
INSERT INTO bitlen_example VALUES
(42), (101), (99), (13), (64), (86);
SELECT BIN(example), BIT_LENGTH(example)
FROM bitlen_example;
+--------------+---------------------+
| BIN(example) | BIT_LENGTH(example) |
+--------------+---------------------+
| 101010 | 16 |
| 1100101 | 24 |
| 1100011 | 16 |
| 1101 | 16 |
| 1000000 | 16 |
| 1010110 | 16 |
+--------------+---------------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.