This tutorial explains how to use the MySQL ASCII function with syntax and examples.
The MySQL ASCII function returns the numeric value of the left-most character of a string.
The syntax for the ASCII function in MySQL is:
The specified character to retrieve the NUMBER code for. If more than one character is entered, the ASCII function will return the value for the first character and ignore all of the characters after the first.
The ASCII function can be used in the following versions of MySQL:
Let's look at some MySQL ASCII function examples and explore how to use the ASCII function in MySQL.
For example: