LENGTH

All functions > STRING > LENGTH

Returns the number of characters in a string.

Signatures

Returns: Number of characters in the string

LENGTH(string: VARCHAR) → BIGINT
sql
ParameterTypeRequiredDescription
stringVARCHARYesInput string to measure

Notes

  • Counts characters, not bytes
  • Spaces and special characters are counted
  • Unicode characters (emoji, symbols) count as single characters
  • Aliases: LEN, SIZE

Aliases

  • LEN

  • SIZE

Examples

FeatureQL
SELECT
    f1 := LENGTH('Hello World'),  -- Basic string length
    f2 := LENGTH('ABC'),  -- Short string
    f3 := LENGTH('  spaces  '),  -- Spaces are counted
    f4 := LENGTH('😀😁'),  -- Emoji characters
    f5 := LENGTH('€100'),  -- Euro symbol counts as 1
    f6 := LEN('test')  -- Using alias LEN
;
Result
f1 BIGINTf2 BIGINTf3 BIGINTf4 BIGINTf5 BIGINTf6 BIGINT
11310244

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19