This tutorial explains how to use the MySQL CHARACTER_LENGTH function with syntax and examples.
The MySQL CHARACTER_LENGTH function returns the length of the specified string (measured in characters).
The syntax for the CHARACTER_LENGTH function in MySQL is:
CHARACTER_LENGTH( string )
The string to return the length for.
The CHARACTER_LENGTH function can be used in the following versions of MySQL:
Let's look at some MySQL CHARACTER_LENGTH function examples and explore how to use the CHARACTER_LENGTH function in MySQL.
For example:
mysql> SELECT CHARACTER_LENGTH(NULL);
Output: NULL
mysql> SELECT CHARACTER_LENGTH('');
Output: 0
mysql> SELECT CHARACTER_LENGTH(' ');
Output: 1
mysql> SELECT CHARACTER_LENGTH('AODBA.com');
Output: 9