In MySQL, you can use the ASCII()
function to return the ASCII code for a given character. More specifically, it returns the ASCII code for the leftmost character in a given string.
You can also use ORD()
, which works the same way, except that it also supports multibyte characters.