Knowledge Walls
John Peter
Pune, Maharashtra, India
HEX() and UNHEX() method in MySQL with Example
12936 Views
How to convert hexa decimal to string and string to hexa decimal? 
HEX and UNHEX are hexa decimal convertion methods of mysql.

HEX method used to convert each characters of the string to hexa decimal number.
UNHEX method used to convert each hexa decimal numbers to characters.
Example
-- returns 476F64
SELECT HEX('God');

-- returns God, this means 0x prefix also used to represent hexadecimal values
SELECT 0x476F64;

-- or Use unhex. returns God
SELECT UNHEX(476F64);
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details