ASCII (STR)
Returns the ASCII code value of the leftmost character of the string str. If Str is an empty string, returns 0. If STR is NULL, returns NULL.
MySQL Tutorial > select ASCII (' 2 ');
-> 50
Mysql> Select ASCII (2);
-> 50
Mysql> Select ASCII (' DX ');
->
You can also see the Ord () function.
Ord (str)
If the string str leftmost character is a multibyte character, by using the format (the *256+ (the second byte ASCII code)) [*256+third byte ASCII code ...] Returns the ASCII code value of the character to return the multibyte character code. If the leftmost character is not a multibyte character. Returns the same value returned with the ASCII () function.
mysql> Select Ord (' 2 ');
->
Conv (n,from_base,to_base)
Transforms a number between different numeric bases. Returns a string number for the number n, from the From_base base transformation to the to_base base, or null if any argument is null. Parameter n is interpreted as an integer, but can be specified as an integer or a string. The minimum base is 2 and the largest base is 36. If To_base is a negative number, n is considered to be a signed digit, otherwise n is treated as unsigned. Conv work with 64-bit precision.
mysql> Select conv ("a", 16,2);
-> ' 1010 '
Mysql> Select conv ("6e", 18,8);
-> ' 172 '
Mysql> Select conv ( -17,10,-18);
-> '-h '
Mysql> Select conv (10+ "ten" + ' +0xa,10,10 ');
-> '
Bin (N)
Returns a string representation of the binary value N, where n is a long integer (bigint) number, which is equivalent to Conv (n,10,2). If n is null, returns NULL.
mysql> Select Bin (12);
-> ' 1100 '
Oct (n)
Returns the representation of a string of octal value N, where n is a long integer number, which is equivalent to Conv (n,10,8). If n is null, returns NULL.
mysql> Select Oct (12);
-> '
Hex (N)
Returns the hexadecimal value n the representation of a string, where n is a long integer (bigint) number, which is equivalent to Conv (n,10,16). If n is null, returns NULL.
mysql> Select Hex (255);
-> ' FF '
CHAR (n,...)
char () interprets the argument as an integer and returns a string consisting of the ASCII code characters of these integers. The null value is skipped.
mysql> Select char (77,121,83,81, ' 76 ');
-> ' MySQL '
Mysql> Select char (77,77.3, ' 77.3 ');
-> ' mmm '
concat (str1,str2,...)