Collections:
BIT_LENGTH() - Number of Bits in String
How to count the number of bits of a giving string using the BIT_LENGTH() function?
✍: FYIcenter.com
BIT_LENGTH(string) is a MySQL built-in function that returns the
number of Bits of a giving string. For example:
SELECT BIT_LENGTH('O'), BIT_LENGTH('©'), BIT_LENGTH('😋');
-- +-----------------+------------------+--------------------+
-- | BIT_LENGTH('O') | BIT_LENGTH('©') | BIT_LENGTH('😋') |
-- +-----------------+------------------+--------------------+
-- | 8 | 16 | 32 |
-- +-----------------+------------------+--------------------+
Reference information of the LENGTH() function:
BIT_LENGTH(str): num Returns the length of the string str in bits. Arguments, return value and availability: str: Required. The given string to count the number of bits for. num: Return value. The number of bits in the given string. Available since MySQL 5.7.
Related MySQL functions:
⇒ CHAR() - Building String from Byte Values
⇐ ASCII() - ASCII Value of First Character
2023-11-12, 1649🔥, 0💬
Popular Posts:
How To List All Stored Procedures in the Current Database in SQL Server Transact-SQL? If you want to...
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIM...
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS) in SQL Server? Process sqlservr.exe is the...
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...
What Happens to Your Transactions When ERROR 1213 Occurred in MySQL? If your transaction receives th...