Ascii (str)
Returns the ascii code value of the leftmost character of the str string. If str is a Null String, 0 is returned. If 'str' is null, return null.
Mysql tutorial> select ascii ('2 ');
-> 50
Mysql> select ascii (2 );
-> 50
Mysql> select ascii ('dx ');
-> 100
For more information, see the ord () function.
Ord (str)
If the leftmost character of a string 'str' is a multi-byte character, use the format (first byte ascii code) * 256 + (second byte ascii code )) [* 256 + third byte ascii code...] returns the ascii code value of a character to return the multi-byte code. If the leftmost character is not a multi-byte character. Returns the same value as that returned by the ascii () function.
Mysql> select ord ('2 ');
-> 50
Conv (n, from_base, to_base)
Convert numbers between different digit bases. Returns the string Number of number n, which is converted from from_base base to to_base base. If any parameter is null, null is returned. Parameter n is interpreted as an integer, but can be specified as an integer or a string. The minimum base is 2 and the maximum base is 36. If to_base is a negative number, n is considered as a signed number. Otherwise, n is considered as an unsigned number. Conv works with 64-bit precision.
Mysql> select conv ("a", 16, 2 );
-> '123'
Mysql> select conv ("6e", 18, 8 );
-> '123'
Mysql> select conv (-17,10,-18 );
-> '-H'
Mysql> select conv (10 + "10" + '10' + 0xa, 10, 10 );
-> '40'
Bin (n)
Returns a string of the binary value n. Here n is a long integer (bigint) number, which is equivalent to conv (n, 10, 2 ). If n is null, return null.
Mysql> select bin (12 );
-> '123'
Oct (n)
Returns the representation of a string with an octal value n. Here n is a long integer, which is equivalent to conv (n, 10, 8 ). If n is null, return null.
Mysql> select oct (12 );
-> '14'
Hex (n)
Returns the representation of a hexadecimal value n string. Here n is a long integer (bigint) number, which is equivalent to conv (n, 10, 16 ). If n is null, return null.
Mysql & gt; select hex (255 );
-> 'Ff'
Char (n ,...)
Char () interprets the parameter as an integer and returns a string consisting of ascii code characters of these integers. The null value is skipped.
Mysql> select char (77,121, 81, '76 ');
-> 'Mysql'
Mysql> select char (77, 77.3, '77. 3 ');
-> 'Mmm'
Concat (str1, str2 ,...)
1 2 3