Outdated Version
You are viewing an older version of this section. View current production version.
UNHEX
Converts a hexadecimal representation to the binary equivalent.
Syntax
UNHEX(expression)
Arguments
expression
A hexadecimal expression, in upper or lower case.
Return Type
Binary data.
Examples
mysql> select hex('ohai');
+-------------+
| hex('ohai') |
+-------------+
| 6F686169 |
+-------------+
mysql> select unhex('6F686169');
+-------------------+
| unhex('6F686169') |
+-------------------+
| ohai |
+-------------------+
Related Topics