May 2005
Intermediate to advanced
352 pages
14h 39m
English
ASCII( )
ASCII(string)This function returns the ASCII code for the first character of a
given string. If you're entering raw text, you must
enclose string within quotes. If the
argument is a column, do not enclose it in quotes. If
string is empty, 0 is returned.
SELECT ASCII('A') AS A, ASCII(name_last) AS Professor
FROM teachers WHERE name_last = 'McAllister';
+----+-----------+
| A | Professor |
+----+-----------+
| 65 | 77 |
+----+-----------+Only the M in the professor's name is converted to its ASCII equivalent. It displays the ASCII value for A and the first letter of the name.
Read now
Unlock full access