Skip to main content

LENGTH

Description​

Returns the number of bytes in a string.

Syntax​

LENGTH ( <str> )

Parameters​

ParameterDescription
<str>The string whose bytes need to be calculated

Return Value​

The number of bytes in the string <str>.

Example​

SELECT LENGTH("abc"),length("δΈ­ε›½")
+---------------+------------------+
| length('abc') | length('δΈ­ε›½') |
+---------------+------------------+
| 3 | 2 |
+---------------+------------------+