ASCII(str): Returns the numeric value of the leftmost character of the string str : ASCII « String Functions « MySQL Tutorial






Returns 0 if str is the empty string.

Returns NULL if str is NULL.

ASCII() works for characters with numeric values from 0 to 255.

mysql>
mysql> SELECT ASCII('2');
+------------+
| ASCII('2') |
+------------+
|         50 |
+------------+
1 row in set (0.00 sec)

mysql> SELECT ASCII(2);
+----------+
| ASCII(2) |
+----------+
|       50 |
+----------+
1 row in set (0.00 sec)

mysql>
mysql>








23.2.ASCII
23.2.1.ASCII(str): Returns the numeric value of the leftmost character of the string str
23.2.2.Use ASCII with the value in a table