Syntax
ORD(str)
Purpose
ORD() returns the code of the leftmost character in a string. If the leftmost character of a string is a multi-byte character, ORD(str) returns the code of the multi-byte character based on the following formula:
(1st byte code)
+ (2nd byte code * 256)
+ (3rd byte code * 256^2)...
If the leftmost character is not a multi-byte character, ORD() returns the same value as ASCII().
Examples
obclient> SELECT ORD ('Hello');
+---------------+
| ORD ('Hello') |
+---------------+
| 72 |
+---------------+
1 row in set