This example illustrates how to use the ASCII character set.
This example illustrates how to use the ASCII character set.This example illustrates how to use the ASCII character set.
The ASCII Returns the numeric value of the leftmost character of the string.
It returns 0
if str is the empty string. Returns NULL
if str is NULL
. ASCII() works for 8-bit characters.
Query
SELECT ASCII('5');
Output
+------------+ | ASCII('5') | +------------+ | 53 | +------------+
Query
SELECT ASCII(2);
+----------+ | ASCII(2) | +----------+ | 50 | +----------+
Query
+------------------+ | ASCII('sandeep') | +------------------+ | 115 | +------------------+
Query
+-------------+ | ASCII('dx') | +-------------+ | 100 | +-------------+