Name

ORD( )

Synopsis

ORD(string)

This function returns an ordinal value, the position of a character in the ASCII character set, of the first character from the left in a string given.

SELECT ORD('A'), ORD('a');
+----------+----------+
| ORD('A') | ORD('a') |
+----------+----------+
|       65 |       97 |
+----------+----------+

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.