ASCII()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the numeric ASCII value of the leftmost character of the given argument.
USAGE
ASCII(string)
Argument Name | Description |
---|---|
| The character to evaluate |
DETAILS
ASCII()
is a string function that returns the numeric ASCII value of the leftmost character of the given string argument.
The American Standard Code for Information Interchange (ASCII) is a character encoding standard for electronic communication.
A 0
is returned if the argument is an empty string (without any whitespace).
A NULL
is returned if the argument is NULL
.
EXAMPLES
-- Note that .05 evaluates the "0" in 0.05
SELECT ASCII(.05), ASCII('1');
+------------+------------+
| ASCII(.05) | ASCII('1') |
+------------+------------+
| 48 | 49 |
+------------+------------+
SELECT ASCII('Foo'), ASCII('f');
+--------------+------------+
| ASCII('Foo') | ASCII('f') |
+--------------+------------+
| 70 | 102 |
+--------------+------------+