What is the method with the help of which the hexadecimal value can be treated as a number?


For treating the hexadecimal value as a number, we can use the CAST(… AS UNSIGNED) function. Following example will demonstrate it −

mysql> Select 0x54, CAST(0x54 AS UNSIGNED);
+------+------------------------+
| 0x54 | CAST(0x54 AS UNSIGNED) |
+------+------------------------+
| T    |                     84 |
+------+------------------------+
1 row in set (0.01 sec)

Updated on: 22-Jun-2020

49 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements