Declaration
LENGTH(str)
Description
Returns the byte length of str.
Multibyte characters are counted as multiple characters. For example, when you enter five 2-byte characters, CHAR_LENGTH() returns 5, while LENGTH() returns 10.
Examples
obclient> SELECT LENGTH('China'), LENGTH('hello');
+------------------+-----------------+
| LENGTH('China') | LENGTH('hello') |
+------------------+-----------------+
| 6 | 5 |
+------------------+-----------------+
1 row in set