You are viewing an older version of this section. View current production version.
Join the MemSQL Community Today
Get expert advice, develop skills, and connect with others.

ASCII

Returns the ASCII value of the leftmost character of the given string.

Syntax

ASCII (str)

Arguments

  • str: any string or binary object
Info

ASCII only works with 8-bit characters.

Return Type

Integer, or NULL if str is NULL.

Examples

memsql> select ascii('abracadabra');
+----------------------+
| ascii('abracadabra') |
+----------------------+
|                   97 |
+----------------------+