UNHEX() FUNCTION in MySQL

UNHEX() FUNCTION
The MySQL UNHEX function is used to convert a hexadecimal value to a string.

Syntax:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
UNHEX (value);
UNHEX (value);
UNHEX (value);

Parameters:
value: It is used to specify the hexadecimal value to convert.

Example:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mysql> SELECT UNHEX (‘41’);
mysql> SELECT UNHEX (‘41’);
mysql> SELECT UNHEX (‘41’);

Output:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
‘A’
‘A’
‘A’

Explanation:
The string for the specified hexadecimal value is returned.