Syntax

BIT_LENGTH(str)

Description

Returns the length of the string str in bits. If str is not a string, it will be converted to string. If str is NULL, returns NULL.

Examples

SELECT BIT_LENGTH('text');
+--------------------+
| BIT_LENGTH('text') |
+--------------------+
|                 32 |
+--------------------+
SELECT BIT_LENGTH('');
+----------------+
| BIT_LENGTH('') |
+----------------+
|              0 |
+----------------+

Compatibility

PostgreSQL and Sybase support BIT_LENGTH()

Comments

Comments loading...