All pages
Powered by GitBook
1 of 1

Loading...

ASCII

Return the ASCII value of the first character. This function returns the numeric ASCII code for the leftmost character of the input string.

Syntax

ASCII(str)

Description

Returns the numeric ASCII value of the leftmost character of the string argument. Returns 0 if the given string is empty and NULL if it is NULL.

ASCII() works for 8-bit characters.

Examples

This page is licensed: GPLv2, originally from

SELECT ASCII(9);
+----------+
| ASCII(9) |
+----------+
|       57 |
+----------+

SELECT ASCII('9');
+------------+
| ASCII('9') |
+------------+
|         57 |
+------------+

SELECT ASCII('abc');
+--------------+
| ASCII('abc') |
+--------------+
|           97 |
+--------------+
fill_help_tables.sql