LENGTH()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
Count the byte length of a string counting each multi-byte char as multiple bytes unless in ORACLE mode, in which case LENGTH is a synonym for CHAR_
EXAMPLES
SELECT LENGTH('mariadb');
+-------------------+
| LENGTH('mariadb') |
+-------------------+
| 7 |
+-------------------+
SELECT LENGTH(' ');
+---------------+
| LENGTH(' ') |
+---------------+
| 3 |
+---------------+
SELECT LENGTH(_utf8 x'E28098');
+-------------------------+
| LENGTH(_utf8 x'E28098') |
+-------------------------+
| 3 |
+-------------------------+
SET sql_mode=CONCAT(@@sql_mode, ',ORACLE');
SELECT LENGTH(_utf8 x'E28098');
+-------------------------+
| LENGTH(_utf8 x'E28098') |
+-------------------------+
| 1 |
+-------------------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.