Jump to: navigation, search

Mysql BIT LENGTH

From w3cyberlearnings

Contents

MySQL BIT_LENGTH Function

This function returns the length of a string in bites. Single character is 8 bites.

Syntax BIT_LENGTH

Str: A string or character.

BIT_LENGTH(Str)

Example 1

mysql> SELECT BIT_LENGTH('g');
+-----------------+
| BIT_LENGTH('g') |
+-----------------+
|               8 |
+-----------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT BIT_LENGTH('ga');
+------------------+
| BIT_LENGTH('ga') |
+------------------+
|               16 |
+------------------+
1 row in set (0.00 sec)

Related Links


Navigation
Web
SQL
MISC
References