メインコンテンツまでスキップ
バージョン: 3.x

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("China")
+---------------+------------------+
| length('abc') | length('China') |
+---------------+------------------+
| 3 | 5 |
+---------------+------------------+