MySQL | UNCOMPRESS( ) Function
The MySQL UNCOMPRESS() function is used for uncompressing a string and bring it back to its original state. It is used on string which have been compressed using the COMPRESSED() function.
The MySQL UNCOMPRESS() function returns empty strings if the compressed string is an empty string. It accepts one parameter which is the compressed string to be uncompressed.
Syntax:
UNCOMPRESS(string);
Parameters Used:
string – It is used to specify the compressed string that is to be uncompressed.
Return Value:
The UNCOMPRESS() function in MySQL returns the original string after uncompressing an compressed string.
Supported Versions of MySQL:
- MySQL 5.7
- MySQL 5.6
- MySQL 5.5
- MySQL 5.1
- MySQL 5.0
- MySQL 4.1
Example-1: Implementing UNCOMPRESS function on a string.
SELECT
UNCOMPRESS(COMPRESS('geeskforgeeks'));
Output:
geeksforgeeks
Example-2: Implementing UNCOMPRESS function on a string which has a combination of characters and integers.
SELECT
UNCOMPRESS(COMPRESS('geeskforgeeks123'));
Output:
geeksforgeeks123
Example-3: Implementing COMPRESS function on a NULL string and returning the length of the string after compression.
SELECT UNCOMPRESS(COMPRESS(NULL));
Output:
NULL
Recommended Posts:
- MySQL | MD5 Function
- MySQL | BIN() Function
- MySQL | IF( ) Function
- MySQL | DES_ENCRYPT ( ) Function
- MySQL | USER( ) Function
- MySQL | DES_DECRYPT ( ) Function
- MySQL | ENCODE( ) Function
- MySQL | Group_CONCAT() Function
- MySQL | DECODE( ) Function
- MySQL | OLD_PASSWORD Function
- MySQL | AES_DECRYPT ( ) Function
- MySQL | AES_ENCRYPT ( ) Function
- MySQL | CONV( ) Function
- MySQL | BINARY Function
- MySQL | COMPRESS( ) Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

