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

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

WBOY
Release: 2023-09-03 09:41:06
forward
969 people have browsed it

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template