CodesJava

Easy learning with example program codes

CHARACTER_LENGTH() FUNCTION in MySQL

CHARACTER_LENGTH() FUNCTION
The MySQL CHARACTER_LENGTH function is used to get the length of character in the specified string. The various versions of MySQL supports the CHARACTER_LENGTH function, namely, MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0 and MySQL 3.23.

Syntax:

CHARACTER_LENGTH( string )

Parameters:
Strong>string: It is used to specify the string to evaluate.

Example 1:

mysql> SELECT CHARACTER_LENGTH ( ‘Sum of 2 and 4 is 6);

Output:

19

Explanation:
The number of characters is 19 in the specified string.

Example 2:

mysql> SELECT CHARACTER_LENGTH (‘letsbefriends’);

Output:

13

Explanation:
The number of characters is 13 in the specified string.

Please follow and like us:
error









Copyright © 2019 CodesJava DMCA.com Protection Status