Home  >  Article  >  Database  >  What is the purpose of the MySQL BIT_LENGTH() function?

What is the purpose of the MySQL BIT_LENGTH() function?

WBOY
WBOYforward
2023-09-03 09:41:06941browse

MySQL BIT_LENGTH() 函数的用途是什么?

#Forgetting the length of the string in bits, you can use the MySQL BIT_LENGTH() string function. Its syntax is BIT_LENGTH(Str).

Here, the parameter Str of the BIT_LENGTH() function is the string whose BIT_LENGTH value is to be retrieved. Str can be a string or a numeric string. If it is a string it must be enclosed in quotes.

Example

mysql> Select BIT_LENGTH('tutorialspoint');
+------------------------------+
| BIT_LENGTH('tutorialspoint') |
+------------------------------+
|                          112 |
+------------------------------+
1 row in set (0.00 sec)

mysql> Select BIT_LENGTH(2365489);
+---------------------+
| BIT_LENGTH(2365489) |
+---------------------+
|                  56 |
+---------------------+
1 row in set (0.00 sec)

The above is the detailed content of What is the purpose of the MySQL BIT_LENGTH() function?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete