This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

LENGTH

Sintassi

LENGTH(str)

Spiegazione

Restituisce la lunghezza della stringa str, misurata in byte. Per i caratteri multi-byte, vengono contati i byte piuttosto che i caratteri. Questo significa che per una stringa contenente cinque caratteri di un byte, LENGTH() restituisce 10, mentre CHAR_LENGTH() restituisce 5.

Esempi

MariaDB [test]> SELECT LENGTH('MariaDB');
+-------------------+
| LENGTH('MariaDB') |
+-------------------+
|                 7 |
+-------------------+
1 row in set (0.00 sec)

MariaDB [test]> SELECT LENGTH('un testo');
+--------------------+
| LENGTH('un testo') |
+--------------------+
|                  8 |
+--------------------+
1 row in set (0.00 sec)
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.