ASCII() Return numeric value of left-most character

Returns the numeric value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL. ASCII() works for 8-bit characters.

  1. mysql> SELECT ASCII('2');
  2. -> 50
  3. mysql> SELECT ASCII(2);
  4. -> 50
  5. mysql> SELECT ASCII('dx');
  6. -> 100