Skip to main content
Version: V1.1.0

ASCII

Declaration​

ASCII(str)

Description​

Returns the ASCII code of the leftmost character in the string str.

If str is an empty string, the function returns 0. If str is NULL, the function returns NULL.

Examples​

SELECT ASCII('');
+-----------+
| ASCII('') |
+-----------+
| 0 |
+-----------+
1 row in set (0.001 sec)

SELECT ASCII('oceanbase');
+--------------------+
| ASCII('oceanbase') |
+--------------------+
| 111 |
+--------------------+
1 row in set (0.000 sec)

SELECT ASCII('Oceanbase');
+--------------------+
| ASCII('Oceanbase') |
+--------------------+
| 79 |
+--------------------+
1 row in set (0.000 sec)