Skip to main content
Version: Latest-3.3

ascii

Description

This function returns the ascii value of the leftmost character of a given string.

Syntax

INT ascii(VARCHAR str)

Examples

MySQL > select ascii('1');
+------------+
| ascii('1') |
+------------+
| 49 |
+------------+

MySQL > select ascii('234');
+--------------+
| ascii('234') |
+--------------+
| 50 |
+--------------+

keyword

ASCII