Syntax
ORD(str)
Purpose
You can call this function to return 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('China');
+--------------+
| ORD('China') |
+--------------+
| 67 |
+--------------+
1 row in set