HEX(N_or_S) : HEX « String Functions « MySQL Tutorial






If N_or_S is a number, returns a string representation of the hexadecimal value of N.

If N_or_S is a string, returns a hexadecimal string representation of N_or_S where each character in N_or_S is converted to two hexadecimal digits.

mysql>
mysql> SELECT HEX(255);
+----------+
| HEX(255) |
+----------+
| FF       |
+----------+
1 row in set (0.00 sec)

mysql>








23.15.HEX
23.15.1.HEX(N_or_S)
23.15.2.HEX('abc');
23.15.3.SELECT HEX(CHAR(1,0)), HEX(CHAR(256));
23.15.4.SELECT HEX(CHAR(1,0,0)), HEX(CHAR(256*256));