top of page
CerebroSQL

ORD

Database: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Syntax:
ORD(str)

If the leftmost character of the string str is a multibyte character,
returns the code for that character, calculated from the numeric values
of its constituent bytes using this formula:

(1st byte code)
+ (2nd byte code * 256)
+ (3rd byte code * 256^2) ...

If the leftmost character is not a multibyte character, ORD() returns
the same value as the ASCII() function.

URL: https://dev.mysql.com/doc/refman/8.0/en/string-functions.html

Example

mysql> SELECT ORD('2');
-> 50

bottom of page