arrow-left

All pages
gitbookPowered 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.

hashtag
Syntax

ASCII(str)

hashtag
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.

hashtag
Examples

This page is licensed: GPLv2, originally from

fill_help_tables.sqlarrow-up-right
spinner
SELECT ASCII(9);
+----------+
| ASCII(9) |
+----------+
|       57 |
+----------+

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

SELECT ASCII('abc');
+--------------+
| ASCII('abc') |
+--------------+
|           97 |
+--------------+