Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Python Programs
    • Java Programs

MySQL UNHEX Function

by suresh

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:

SELECT UNHEX(String_Value);

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.

SELECT UNHEX('4D7953514C');

SELECT UNHEX('5475746F7269616C2047617465776179');

SELECT UNHEX('48656C6C6F');

OUTPUT

MySQL UNHEX Function 1

Let me take another MySQL example.

SELECT UNHEX('31303030');

SELECT UNHEX('31303040');

SELECT UNHEX('31302040');

OUTPUT

MySQL UNHEX Function 2

Please refer to HEX() function article.

Placed Under: MySQL

  • How to Download MySQL
  • Install MySQL on Windows
  • MySQL Create Database
  • MySQL Delete Database
  • MySQL Create Table
  • MySQL Drop Table
  • MySQL SELECT Statement
  • MySQL ALIAS Column
  • MySQL Distinct
  • MySQL Insert Statement
  • MySQL Delete
  • MySQL Truncate Table
  • MySQL WHERE Clause
  • MySQL Order By
  • MySQL Group By
  • MySQL Having Clause
  • MySQL LIMIT
  • MySQL Arithmetic Operators
  • MySQL COALESCE Function
  • MySQL AND Operator
  • MySQL NOT Operator
  • MySQL OR Operator
  • MySQL XOR Operator
  • MySQL BETWEEN Operator
  • MySQL Not Between Operator
  • MySQL GREATEST Function
  • MYSQL LEAST Function
  • MySQL LIKE Operator
  • MySQL NOT LIKE Operator
  • MySQL IFNULL Operator
  • MySQL NULLIF Operator
  • MySQL INTERVAL Operator
  • MySQL IS Operator
  • MySQL IN Operator
  • MySQL NOT IN Operator
  • MySQL IS NOT NULL
  • MySQL IS NULL
  • MySQL Inner Join
  • MySQL Cross Join
  • MySQL Right Join
  • MySQL Left Join
  • MySQL Aggregate Functions
  • MySQL Date Functions
  • MySQL Date Function
  • MySQL String Functions
  • MySQL Numeric Functions
  • C Tutorial
  • C# Tutorial
  • Java Tutorial
  • JavaScript Tutorial
  • Python Tutorial
  • MySQL Tutorial
  • SQL Server Tutorial
  • R Tutorial
  • Power BI Tutorial
  • Tableau Tutorial
  • SSIS Tutorial
  • SSRS Tutorial
  • Informatica Tutorial
  • Talend Tutorial
  • C Programs
  • C++ Programs
  • Java Programs
  • Python Programs
  • MDX Tutorial
  • SSAS Tutorial
  • QlikView Tutorial

Copyright © 2021 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy