Syntax
ORD(str)
Purpose
Returns the ASCII code of the leftmost character of a string. For single-byte encoding, if the leftmost character is a multibyte character, the value is calculated as follows:
(1st byte code)
+ (2nd byte code * 256)
+ (3rd byte code * 256^2) ...
The ORD() function returns the same value as the ASCII() function if the leftmost character is not a multibyte character.
Examples
obclient> SELECT ORD('China');
+---------------+
| ORD('China') |
+---------------+
| 14989485 |
+---------------+
1 row in set