ORD()
ORD(string)This function returns an ordinal value, the position of a character in the ASCII character set of the leftmost character in a given string. For multibyte characters, it follows a formula to determine the results: byte1 + (byte2 * 256) + (byte3 *2562)....
Here is an example:
SELECT ORD('A'), ORD('a');
+----------+----------+
| ORD('A') | ORD('a') |
+----------+----------+
| 65 | 97 |
+----------+----------+