Product Solutions Support
Try MemSQL

UNHEX

Converts a hexadecimal representation to the binary equivalent.

Syntax

UNHEX(expression)

Arguments

expression

A hexidecimal 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              |
+-------------------+
Was this article useful?