Jump to: navigation, search

Mysql HEX

From w3cyberlearnings

Contents

MySQL HEX Function

This function returns a hexdecimal number of a given string or number. Check ASCII or ASCII Standard

Syntax HEX

Str: is a given string or number

HEX(Str);

Example 1

mysql> SELECT HEX('b');
+----------+
| HEX('b') |
+----------+
| 62       |
+----------+
1 row in set (0.00 sec)

Example 2

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

Example 3

mysql> SELECT HEX('bbc');
+------------+
| HEX('bbc') |
+------------+
| 626263     |
+------------+
1 row in set (0.00 sec)

Related Links


Navigation
Web
SQL
MISC
References