MySQL UNHEX function is one of the String Function, which is to convert the Hexadecimal number into the bytes represented by the Number. The return value of this function is a binary string. We can call this MySQL UNHEX function as an inverse of HEX() function.
The basic syntax of the UNHEX Function in MySQL is as shown below:
The characters that we specify as an UNHEX argument must represent legal hexadecimal digits, such as 0 to 9, A to F, and a to f.
If you provide any of the non-hexadecimal digits, this function returns NULL.
MySQL Un-Hexadecimal Function Example
The UnHexadecimal Function in MySQL converts the Hexadecimal digits to a string. The following String Function query shows you multiple ways to use this UNHEX function.
Let me take another MySQL example.
Please refer to HEX() function article.