Calculates the length of the input string.
When used with an array argument, LENGTH is a synonym for ARRAY_LENGTH
Syntax
Parameters
| Parameter | Description | Supported input types |
|---|
<expression> | The string or binary data for which to return the length. | TEXT, BYTEA. For ARRAY, see ARRAY_LENGTH |
Return Type
INTEGER
Example
Use the LENGTH to find the length of any string, such as:
SELECT LENGTH('The Accelerator Cup');
Rows: 1Execution time: 6.03ms
Spaces are included in the calculation of the total length of the string.