char_length

Syntax

CHAR_LENGTH (string)

Popis

Príkaz jazyka SQL MySQL CHAR_LENGTH() returns the length (how many characters are there) of a given string. The function simply count the number characters and ignore whether the character(s) are single-byte or multi-byte. Therefore a string containing three 2-byte characters, LENGTH() function will returns 6, whereas CHAR_LENGTH() function will returns 3.

Príklad

SELECT length(_utf8 'čau'), char_length(_utf8 'čau'); //vráti: 4, 3