w3resource

MySQL UNCOMPRESSED_LENGTH() function

UNCOMPRESSED_LENGTH() function

MySQL UNCOMPRESSED_LENGTH() returns the length of the string before it had been compressed.

Syntax:

UNCOMPRESSED_LENGTH(string)

Argument:

Name Description
str A compressed string.

Syntax Diagram:

MySQL UNCOMPRESSED_LENGTH() Function - Syntax Diagram

MySQL Version: 8.0


Example:

Code:

SELECT UNCOMPRESSED_LENGTH(COMPRESS('w3resource'));

Explanation

The above MySQL statement returns 10, which is the length of the original string w3resource.

Output:

mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS('w3resource'));
+---------------------------------------------+
| UNCOMPRESSED_LENGTH(COMPRESS('w3resource')) |
+---------------------------------------------+
|                                          10 | 
+---------------------------------------------+
1 row in set (0.00 sec)

Previous: UNCOMPRESS()
Next: MySQL Bit functions BIT_COUNT



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/mysql/encryption-and-compression-functions/uncompressed_length().php