ascii
function
Applies to: Databricks SQL
Databricks Runtime
Returns the ASCII code point of the first character of str
.
ascii(str)
str
: A STRING.
An INTEGER.
If str
is empty, the result is 0.
If the first character is not an ASCII character or part of the Latin-1 Supplement range of UTF-16, the result is undefined.
> SELECT ascii('234');
50
> SELECT ascii('');
0