MySQL OCTET_LENGTH() function
OCTET_LENGTH() function
MySQL OCTET_LENGTH() returns the length (in characters) of a string.
Syntax:
OCTET_LENGTH(str)
Argument:
Name | Description |
---|---|
str | A string whose length is to be returned. |
The above function is a synonym for LENGTH().
Syntax Diagram:
MySQL Version: 5.6
Video Presentation:
Example: MySQL OCTET_LENGTH() function
The following MySQL statement will return the length of the string w3resource. The return value is 10.
Code:
SELECT OCTET_LENGTH("w3resource");
Sample Output:
mysql> SELECT OCTET_LENGTH("w3resource"); +----------------------------+ | OCTET_LENGTH("w3resource") | +----------------------------+ | 10 | +----------------------------+ 1 row in set (0.00 sec)
All String Functions
Previous: NOT REGEXP
Next: ORD
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework