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