character_length(str)函数是MySQL的一个字符串函数。此方法与返回给定字符串大小的 char_length() 函数相同。
语法
select character_length(str);
示例 1
select character_length('yxjc123');
输出:
mysql> select character_length('yxjc123');
+-----------------------------+
| character_length('yxjc123') |
+-----------------------------+
| 7 |
+-----------------------------+
1 row in set (0.00 sec)
示例 2
select character_length('mysql');
输出:
mysql> select character_length('mysql');
+---------------------------+
| character_length('mysql') |
+---------------------------+
| 5 |
+---------------------------+
1 row in set (0.00 sec)