- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the purpose of using MySQL CHAR_LENGTH() function? Which function is the synonym of it?
MySQL CHAR_LENGTH() is used to retrieve the length of a specified string. This function will simply count the number of characters and ignores whether the characters are of single-byte or multi-byte. MySQL CHARACTER_LENGTH() function is a synonym of it. The syntax of these functions are as follows −
Syntax of CHAR_LENGTH
CHAR_LENGTH (Str)
Here, Str is the string whose length is to be retrieved.
Syntax of CHARACTER_LENGTH
CHARACTER_LENGTH (Str)
Here, Str is the string whose length is to be retrieved.
Example
mysql> Select CHAR_LENGTH('tutorialspoint'); +-------------------------------+ | CHAR_LENGTH('tutorialspoint') | +-------------------------------+ | 14 | +-------------------------------+ 1 row in set (0.03 sec) mysql> Select CHARACTER_LENGTH('tutorialspoint'); +------------------------------------+ | CHARACTER_LENGTH('tutorialspoint') | +------------------------------------+ | 14 | +------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- Which function is a synonym of MySQL LENGTH() function?
- What is the purpose of MySQL TRIM() function?
- What is the difference between MySQL LENGTH() and CHAR_LENGTH() function?
- What MySQL CHAR_LENGTH() function returns if no parameter is provided to it?
- MySQL BIT_LENGTH() function is used for which purpose?
- What will MySQL CHAR_LENGTH() function return if I provide NULL to it?
- What is the purpose of a function prototype in C/C++?
- What is the purpose of a self-executing function in JavaScript?
- What is the purpose of COALESCE function? Explain with the help of an example.
- What is the use of MySQL SUBSTRING_INDEX() function?
- What is the use of MySQL UNHEX() function?
- What is the use of MySQL CHAR() function?
- What is the use of MySQL FROM_UNIXTIME() function?
- What is the use of MySQL GET_FORMAT() function?
- What is the use of MySQL LAST_INSERT_ID() function?

Advertisements