Purpose
This function converts multibyte characters in a string to their corresponding single-byte character forms.
Note
For V4.4.2, this function is available starting from V4.4.2 BP2.
Syntax
TO_SINGLE_BYTE(str)
Parameters
str: The string to be converted.
Notice
If any multibyte character in str has no single-byte equivalent, it is displayed as a multibyte character in the output string.
Return type
The return value has the same data type as str.
Examples
Converts full-width characters in a string to half-width characters.
obclient> SELECT TO_SINGLE_BYTE('China A')
The return result is as follows:
+-----------------------------+
| TO_SINGLE_BYTE('China A') |
+-----------------------------+
| China A |
+-----------------------------+
1 row in set
