The ASCII function returns the ASCII code of the most left character in numeric value. If an input string is NULL, NULL is returned.
This function supports single-byte character sets only. If a numeric value is entered, it is converted into character string and then the ASCII code of the most left character is returned.
ASCII(str)
SELECT ASCII('5');
53
SELECT ASCII('ab');
97